From cd5087db4f48190be0b2eb488352be394498a1d2 Mon Sep 17 00:00:00 2001 From: Zlatko Bratkovic Date: Wed, 7 Feb 2024 18:30:15 +0100 Subject: [PATCH] BUG/MINOR: build: if tag does not exist use dev as tag --- build/Dockerfile | 2 +- build/Dockerfile.pebble | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index c43e074c..2ce7981c 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -24,7 +24,7 @@ COPY / /src RUN mkdir -p /var/run/vars && \ cd /src && \ - git describe --abbrev=0 --tags > /var/run/vars/GIT_LAST_TAG && \ + git describe --abbrev=0 --tags > /var/run/vars/GIT_LAST_TAG || echo "dev" > /var/run/vars/GIT_LAST_TAG && \ CGO_ENABLED=0 go build \ -ldflags "-X github.com/haproxytech/kubernetes-ingress/pkg/version.GitTag=$(cat /var/run/vars/GIT_LAST_TAG)" \ -o fs/haproxy-ingress-controller . diff --git a/build/Dockerfile.pebble b/build/Dockerfile.pebble index 00a6cd3c..f0349462 100644 --- a/build/Dockerfile.pebble +++ b/build/Dockerfile.pebble @@ -26,7 +26,7 @@ RUN go install github.com/canonical/pebble/cmd/pebble@v1.2.0 RUN mkdir -p /var/run/vars && \ cd /src && \ - git describe --abbrev=0 --tags > /var/run/vars/GIT_LAST_TAG && \ + git describe --abbrev=0 --tags > /var/run/vars/GIT_LAST_TAG || echo "dev" > /var/run/vars/GIT_LAST_TAG && \ CGO_ENABLED=0 go build \ -ldflags "-X github.com/haproxytech/kubernetes-ingress/pkg/version.GitTag=$(cat /var/run/vars/GIT_LAST_TAG)" \ -o fs/haproxy-ingress-controller .