Skip to content

chore(ci): only push Docker image on tags#47

Merged
mdelapenya merged 1 commit intotestcontainers:mainfrom
mdelapenya:publish-on-tags
Nov 9, 2022
Merged

chore(ci): only push Docker image on tags#47
mdelapenya merged 1 commit intotestcontainers:mainfrom
mdelapenya:publish-on-tags

Conversation

@mdelapenya
Copy link
Member

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".

@mdelapenya mdelapenya added the enhancement New feature or request label Nov 8, 2022
@mdelapenya mdelapenya self-assigned this Nov 8, 2022
Copy link
Member

@eddumelendez eddumelendez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mdelapenya mdelapenya merged commit 11b8837 into testcontainers:main Nov 9, 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)
@kiview
Copy link
Member

kiview commented Nov 14, 2022

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants