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}