Skip to content

Commit

Permalink
ci(ct): on release branches make the base image tags short and add ad…
Browse files Browse the repository at this point in the history
…ditional revision tag
  • Loading branch information
poikilotherm committed Aug 30, 2024
1 parent f15c9d6 commit a5c38ff
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/container_maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,23 @@ jobs:
echo "newer_packages=false" >> "${GITHUB_OUTPUT}"
fi
- name: Calculate revision number for immutable tag
- name: Calculate revision number for immutable tag (on release branches only)
if: ${{ matrix.branch != env.DEVELOP_BRANCH }}
run: |
# Get the revision logic script (not present on older releases)
curl -sSL "https://github.com/${GITHUB_REPOSITORY}/archive/${DEVELOP_BRANCH}.tar.gz" | \
tar -zxf - -C "." --wildcards "*/.github/workflows/scripts/get_next_revision.sh" --strip-components=1
# Now get the new revision number
echo "REVISION_OPTION=-Dbase.image.revision=$( .github/workflows/scripts/get_next_revision.sh "${BASE_IMAGE}" )" | tee -a "${GITHUB_ENV}"
REVISION_TAG="'${base.image.tag}'-$( .github/workflows/scripts/get_next_revision.sh "${BASE_IMAGE}" )"
echo "DOCKER_TAGS=-Dbase.image.tag='${base.image.tag.release}' -Ddocker.imagePropertyConfiguration=override -Ddocker.tags.revision=$REVISION_TAG" | tee -a "${GITHUB_ENV}"
- name: Configure update of "latest" tag for development branch
if: ${{ matrix.branch == env.DEVELOP_BRANCH }}
run: |
echo "DOCKER_TAGS=-Ddocker.imagePropertyConfiguration=override -Ddocker.tags.develop=latest" | tee -a "${GITHUB_ENV}"
- name: Deploy multi-arch base container image to Docker Hub
if: ${{ steps.temurin-check.outputs.newer_java_image == 'true' || steps.package-check.outputs.newer_packages == 'true' || inputs.force_build }}
id: build
run: mvn -f modules/container-base -Pct deploy -Ddocker.noCache ${DOCKER_TAGS} ${REVISION_OPTION} -Ddocker.platforms=${{ env.PLATFORMS }}
run: mvn -f modules/container-base -Pct deploy -Ddocker.noCache ${DOCKER_TAGS} -Ddocker.platforms=${{ env.PLATFORMS }}

# - if: always()
# name: Save status (workaround for matrix outputs)
Expand Down

0 comments on commit a5c38ff

Please sign in to comment.