Skip to content

Commit

Permalink
add only if branch is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
mjudeikis authored and ntnn committed Dec 20, 2024
1 parent d0d34e8 commit f3bbebc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hack/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ fi
repository=ghcr.io/kcp-dev/kcp
architectures="amd64 arm64"

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

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

# Prefix with "dev-" if not on a tag or branch
if [ -z "$branchName" ]; then
version="dev-$version"
fi

image="$repository:$version"
echo "Building container image $image ..."

Expand Down

0 comments on commit f3bbebc

Please sign in to comment.