Skip to content

Commit 81ed51e

Browse files
committed
add only if branch is not set
1 parent e11ab09 commit 81ed51e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

hack/build-image.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ fi
4040
repository=ghcr.io/kcp-dev/kcp
4141
architectures="amd64 arm64"
4242

43-
# when building locally, just tag with the current HEAD hash with a "dev-" prefix for GC.
44-
version="dev-$(git rev-parse --short HEAD)"
43+
# when building locally, just tag with the current HEAD hash.
44+
version="$(git rev-parse --short HEAD)"
4545
branchName=""
4646

4747
# deduce the tag from the Prow job metadata
@@ -60,6 +60,11 @@ if [ -n "${PULL_BASE_REF:-}" ]; then
6060
fi
6161
fi
6262

63+
# Prefix with "dev-" if not on a tag or branch
64+
if [ -z "$branchName" ]; then
65+
version="dev-$version"
66+
fi
67+
6368
image="$repository:$version"
6469
echo "Building container image $image ..."
6570

0 commit comments

Comments
 (0)