From 9a9939896172b53835b1e52c869286fe4ff093cb Mon Sep 17 00:00:00 2001 From: Kilian Schuettler Date: Wed, 23 Oct 2024 13:56:10 +0200 Subject: [PATCH] RED-10260: add quote char to component mapping --- publish-custom-image.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/publish-custom-image.sh b/publish-custom-image.sh index 5a0def0ea..b1ccc510a 100755 --- a/publish-custom-image.sh +++ b/publish-custom-image.sh @@ -9,11 +9,14 @@ gradle assemble # Get the current Git branch branch=$(git rev-parse --abbrev-ref HEAD) +# Replace any slashes (e.g., in 'feature/' or 'release/') with a hyphen +cleaned_branch=$(echo "$branch" | sed 's/\//_/g') + # Get the short commit hash (first 5 characters) commit_hash=$(git rev-parse --short=5 HEAD) # Combine branch and commit hash -buildName="${USER}-${branch}-${commit_hash}" +buildName="${USER}-${cleaned_branch}-${commit_hash}" gradle bootBuildImage --publishImage -PbuildbootDockerHostNetwork=true -Pversion=${buildName}