Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
This PR sets up a Docker image for the
shipyrd-gem
gem.Why?
To enable non-Ruby projects using Kamal as a deployment tool to benefit from Shipyrd without needing to install Ruby in their development environment.
How?
Workflow: The PR adapts Kamal's
docker-publish.yml
workflow, only changing the repository name. Note that a new image will be generated on each release.Dockerfile: A simplified Kamal
Dockerfile
is created, removing Docker and SSH dependencies, and excluding an entry point.Scripts: 4 new scripts are added to the
./bin
directory to run Shipyrd triggers. Users should add the following line to each Kamal hook supported by Shipyrd:-v "${PWD}:/workdir"
: Binds the current directory to/workdir
to access the latest commit message.--env-file <(env | grep -E '^(KAMAL_|SHIPYRD_)')
: Passes Kamal and Shipyrd environment variables to theshipyrd-gem
container.$(basename $0)
: Generalizes the command to be hook agnostic.Testing
Tested on a Ruby on Rails project using a standard terminal and a DevContainer (within Docker). It is working fine. The
shipyrd-gem
image used for testing is available here.Limitations
The
shipyrd-gem
container can't access thegh
CLI to retrieve the GitHub username.Next steps
Post-approval, the repository owner should create a repository secret namedNo need for this step, I just knew aboutGH_TOKEN
with a GitHub personal access token that haswrite:packages
permission.secrets.GITHUB_TOKEN
being predefined in GitHub Actions.Also, the main Shipyrd repository documentation should be updated.
Enhancements
./bin
into 1 script with an argument variable.