From 805008b0a7aa310db000dc361006f74d10e42594 Mon Sep 17 00:00:00 2001 From: "konveyor-ci-bot[bot]" <159171263+konveyor-ci-bot[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 10:21:01 -0500 Subject: [PATCH] :sparkles: Use build args for the version string (#778) (#779) Signed-off-by: Dylan Murray Signed-off-by: Cherry Picker Signed-off-by: Dylan Murray Signed-off-by: Cherry Picker Co-authored-by: Dylan Murray --- .github/workflows/march-image-build-push.yml | 3 +++ Dockerfile | 4 +++- Makefile | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/march-image-build-push.yml b/.github/workflows/march-image-build-push.yml index e70724b8..6e87946b 100644 --- a/.github/workflows/march-image-build-push.yml +++ b/.github/workflows/march-image-build-push.yml @@ -21,6 +21,9 @@ jobs: image_name: "tackle2-hub" containerfile: "./Dockerfile" architectures: '[ "amd64", "arm64" ]' + extra-args: | + --build-arg + VERSION=${{ github.tag}}-${{ github.ref }} secrets: registry_username: ${{ secrets.QUAY_PUBLISH_ROBOT }} registry_password: ${{ secrets.QUAY_PUBLISH_TOKEN }} diff --git a/Dockerfile b/Dockerfile index f7d573cd..137948d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,13 +15,15 @@ FROM quay.io/konveyor/static-report as report FROM registry.access.redhat.com/ubi9/ubi-minimal ARG SEED_ROOT +ARG VERSION=latest COPY --from=builder /opt/app-root/src/bin/hub /usr/local/bin/tackle-hub -COPY --from=builder /opt/app-root/src/bin/.build /etc/hub-build COPY --from=builder /opt/app-root/src/auth/roles.yaml /tmp/roles.yaml COPY --from=builder /opt/app-root/src/auth/users.yaml /tmp/users.yaml COPY --from=builder ${SEED_ROOT}/resources/ /tmp/seed COPY --from=report /usr/local/static-report /tmp/analysis/report +RUN echo "${VERSION}" > /etc/hub-build + RUN microdnf -y install \ sqlite \ && microdnf -y clean all diff --git a/Makefile b/Makefile index 32a72d97..77de6b71 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,6 @@ debug: generate fmt vet docker: vet go build $(BUILD) - git describe --always --match "v[0-9]*" --tags HEAD > bin/.build # Run against the configured Kubernetes cluster in ~/.kube/config run: fmt vet