3 Commits

Author SHA1 Message Date
Elijah Shaw-Rutschman 5606c1fd5d Better dockerRunArgs handling, ensure slug is lowercase
Some `dockerRunArg` values would fail, due to improper handling of quotes. This is sidestepped by parsing the arguments into an array using `shlex`, then passing the array items as separate N arguments to `run-on-arch.sh`.

It also seems that the container names must be lower-case, so we ensure the `slug()` function returns a lower-case string. Some GitHub repositories will have upper-case letters.
2020-09-07 18:38:06 -05:00
Elijah Shaw-Rutschman af230f8ec2 New input parameters, various improvements
* `githubToken`: Your GitHub token, used for caching Docker images in your project's public package registry. Usually this would just be `${{ github.token }}`. This speeds up builds and is highly recommended.
* `env`: Environment variables to propagate to the container. YAML, but must begin with a | character. These variables will be available in both run and setup.
* `shell`: The shell to run commands with in the container. Default: `/bin/sh` on Alpine, `/bin/bash` for other distros.
* `dockerRunArgs`: Additional arguments to pass to `docker run`, such as volume mappings. See [`docker run` documentation](https://docs.docker.com/engine/reference/commandline/run).
* `setup`: Shell commands to execute on the host before running the container, such as creating directories for volume mappings.

Other changes:

* Rename `additionalArgs` -> `dockerRunArgs` for clarity
* Rename `architecture` -> `arch`, `distribution` -> `distro` for brevity
* Add unit tests for all the inputs, run unit tests in a matrix against multiple distros/archs
* Fix Alpine (`/bin/bash` doesn't exist because BusyBox, must use `/bin/sh`)
* Improved docs and updated examples
* Passing the `run` commands inline to `docker run` was causing issues depending on the script's contents. That is fixed by instead placing `run` commands in a script file.
2020-09-05 13:33:26 -05:00
Umberto Raimondi a20d25845a Move run-on-arch to root 2019-09-28 21:37:13 +02:00