Fix & Refactor the Release and Docker publishing pipeline#423
Merged
Conversation
Foresight Summary
View More Details✅ CI workflow has finished in 3 minutes 11 seconds and finished at 8th Apr, 2023.
*You can configure Foresight comments in your organization settings page. |
arm4b
commented
Apr 8, 2023
| @@ -1 +1 @@ | |||
| FROM bitovi/bitops:{{ tags.bitops_base | default("dev-base") }} | |||
| FROM bitovi/bitops:{{ tag[0] | replace('v', '') }}{{ tag[1:] }} | |||
Contributor
Author
There was a problem hiding this comment.
FYI what this does, - removes the v prefix (if exists) from v1.2.3 in the Docker tag during templating
arm4b
commented
Apr 8, 2023
Comment on lines
+197
to
+216
| name: Tag the Docker image | ||
| id: meta | ||
| uses: docker/metadata-action@v4 | ||
| with: | ||
| images: | | ||
| bitovi/bitops | ||
| # disable automatic 'latest' tag generation | ||
| flavor: latest=false | ||
| # https://bitops.sh/versioning/ | ||
| tags: | | ||
| # DEVELOPMENT | ||
| # On 'main' branch push, - build 'omnibus' image and publish it as 'dev' Docker tag | ||
| type=raw,value=dev,enable=${{ (github.ref_name == 'main') && (matrix.target == 'omnibus') }} | ||
| # RELEASE | ||
| # On a versioned release push '2.0.0-omnibus', '2.0.0-aws-ansible', etc Docker tags | ||
| type=semver,pattern={{version}}-${{ matrix.target }},enable=${{ github.event_name == 'release' }} | ||
| # If omnibus release, push additional versioned '1.2.3' Docker tag | ||
| type=semver,pattern={{version}},enable=${{ (github.event_name == 'release') && (matrix.target == 'omnibus') }} | ||
| # On release update additional 'latest' Docker tag for Omnibus image | ||
| type=raw,value=latest,enable=${{ (github.event_name == 'release') && (matrix.target == 'omnibus') }} |
Contributor
Author
There was a problem hiding this comment.
The BitOps versioning tagging strategy is happening here with help of
https://github.com/marketplace/actions/docker-metadata-action
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.
Closes #293, and also fixes the Release pipelines for Docker images so we don't need to run it manually including the version in the workflow dispatch.
Instead of that, the version is taken from the release/tag automatically.
With that, the release pipeline takes care of proper Docker image building and publishing when release manager creates a versioned release on Github.
Docker build rules
The BitOps docker image versioning is described in the https://bitops.sh/versioning/#images and it works as before. Logically NO changes to these rules were introduced.
To repeat:
PRbuild: (now added)mainbranch:dev-basedocker tagomnibusimage (based ondev-base) and push it withdevdocker tagv1.2.31.2.3-base,base1.2.3-base) and tag it as:omnibus-1.2.3,1.2.3,latestaws-ansible-1.2.3,aws-helm-1.2.3,aws-terraform-1.2.3The release pipelines were tested in my fork of BitOps https://github.com/armab/bitops/commits/main and Docker Hub.