Skip to content

Commit 7bf8cd5

Browse files
authored
Merge pull request #3220 from mjudeikis/mjudeikis/publish.pr.images
✨ Add prefix to dev images for gc
2 parents 1afb207 + 81ed51e commit 7bf8cd5

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,7 +40,7 @@ fi
4040
repository=ghcr.io/kcp-dev/kcp
4141
architectures="amd64 arm64"
4242

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

@@ -60,14 +60,19 @@ 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

6671
# build image for all architectures
6772
for arch in $architectures; do
6873
fullTag="$image-$arch"
6974

70-
echo "Building $version-$arch ..."
75+
echo "Building $fullTag ..."
7176
buildah build-using-dockerfile \
7277
--file Dockerfile \
7378
--tag "$fullTag" \

0 commit comments

Comments
 (0)