chore(ci): only push Docker image on tags#47
Merged
mdelapenya merged 1 commit intotestcontainers:mainfrom Nov 9, 2022
Merged
Conversation
HofmeisterAn
approved these changes
Nov 8, 2022
mdelapenya
added a commit
to mdelapenya/moby-ryuk
that referenced
this pull request
Nov 9, 2022
* main: chore(ci): only push Docker image on tags (testcontainers#47)
Member
|
The follow-up also sounds good. Another idea to consider would be trying out YAML templating, to reuse parts of the pipeline definition (but only if we see even more duplications in the future). |
mdelapenya
added a commit
to gesellix/moby-ryuk
that referenced
this pull request
Dec 1, 2022
* main: feat: add golangci-lint (testcontainers#48) chore: add unit tests for Prune function (testcontainers#46) chore(ci): only push Docker image on tags (testcontainers#47) chore: bump build system versions (testcontainers#45) chore: rename branch to main (testcontainers#44)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 does this PR do?
It copies the current build pipeline to a push pipeline, removing any interaction to Docker Hub from the build one.
The push pipeline will remove any scripted conditional in the pipeline to detect that the Github event was triggered by a release. This is possible because the workflow will only listen for published releases events.
Why is it important?
Separation of concerns: we want to build on pushes and PRs, but only publish on tags. It will also increase the maintainability of the pipelines: having separate descriptors will help reviewers to identify where a change must be done.
Follow ups
We could add snapshots to the push-to-main event. Because the tags will be stored at Docker Hub (no issue for us with the space), we could build&push the Docker image for the main branch, using the last commit as Docker tag. We could use this tag in e2e tests everywhere without needing to "locally" build Ryuk for specific purpose, just as simple as consuming the "snapshot".