Skip to content

Commit 0986cad

Browse files
authored
✨ Use build args for the version string (#778)
Signed-off-by: Dylan Murray <[email protected]>
1 parent f25e7fb commit 0986cad

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

.github/workflows/march-image-build-push.yml

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
image_name: "tackle2-hub"
2222
containerfile: "./Dockerfile"
2323
architectures: '[ "amd64", "arm64" ]'
24+
extra-args: |
25+
--build-arg
26+
VERSION=${{ github.tag}}-${{ github.ref }}
2427
secrets:
2528
registry_username: ${{ secrets.QUAY_PUBLISH_ROBOT }}
2629
registry_password: ${{ secrets.QUAY_PUBLISH_TOKEN }}

Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ FROM quay.io/konveyor/static-report as report
1515

1616
FROM registry.access.redhat.com/ubi9/ubi-minimal
1717
ARG SEED_ROOT
18+
ARG VERSION=latest
1819
COPY --from=builder /opt/app-root/src/bin/hub /usr/local/bin/tackle-hub
19-
COPY --from=builder /opt/app-root/src/bin/.build /etc/hub-build
2020
COPY --from=builder /opt/app-root/src/auth/roles.yaml /tmp/roles.yaml
2121
COPY --from=builder /opt/app-root/src/auth/users.yaml /tmp/users.yaml
2222
COPY --from=builder ${SEED_ROOT}/resources/ /tmp/seed
2323
COPY --from=report /usr/local/static-report /tmp/analysis/report
2424

25+
RUN echo "${VERSION}" > /etc/hub-build
26+
2527
RUN microdnf -y install \
2628
sqlite \
2729
&& microdnf -y clean all

Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ debug: generate fmt vet
6060

6161
docker: vet
6262
go build $(BUILD)
63-
git describe --always --match "v[0-9]*" --tags HEAD > bin/.build
6463

6564
# Run against the configured Kubernetes cluster in ~/.kube/config
6665
run: fmt vet

0 commit comments

Comments
 (0)