From 6113b998812b1cc4d6575fc5d59bc8bcbbab2a26 Mon Sep 17 00:00:00 2001 From: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com> Date: Fri, 16 Sep 2022 19:23:33 +0200 Subject: [PATCH] ci: adjust build arguments (#2772) The build arguments `VCS_REF` and `VCS_VER` were renamed and given proper values according to their names. 1. `VCS_REVISION` holds the current SHA sum of the (git) HEAD pointer 2. `VCS_VERSION` now holds the contents of the `VERSION` file, i.e. a semver version tag (one can now inspect the image and find a proper version tag in the `org.opencontainers.image.version` label) The build arguments were given defaults in order to allow the `generic_build` and `generic_test` workflows to omit them (as they are not need there anyways). When publishing images, this is fina as the cache will rebuild almost all of the image except the last few layers which are `LABEL`s anyways. --- .github/workflows/generic_build.yml | 3 --- .github/workflows/generic_publish.yml | 9 +++++++-- .github/workflows/generic_test.yml | 3 --- Dockerfile | 8 ++++---- Makefile | 8 ++++---- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 8ec3944d..67542b9c 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -83,9 +83,6 @@ jobs: uses: docker/build-push-action@v3.1.1 with: context: . - build-args: | - VCS_REF=${{ github.sha }} - VCS_VER=${{ github.ref }} # Build at least the AMD64 image (which runs against the test suite). platforms: ${{ inputs.platforms }} # Paired with steps `actions/cache` and `Replace cache` (replace src with dest): diff --git a/.github/workflows/generic_publish.yml b/.github/workflows/generic_publish.yml index 901b9d95..945b51c9 100644 --- a/.github/workflows/generic_publish.yml +++ b/.github/workflows/generic_publish.yml @@ -66,13 +66,18 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: 'Acquire the image version' + id: get-version + shell: bash + run: echo "::set-output name=version::$(