Skip to content
Snippets Groups Projects
Commit edd51f40 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

Merge branch 'feat/slug-improve' into 'master'

fix : Adding Git branch slug in SNAPSHOT versions for Merge Request

Closes #75

See merge request to-be-continuous/maven!102
parents d45f8d6e afcc0b0c
Branches
Tags
No related merge requests found
......@@ -576,12 +576,12 @@ stages:
# only on a branch commit, with deploy and "SNAPSHOT with slug" enabled
function maybe_inject_slug_in_version() {
if [[ "$CI_COMMIT_BRANCH" ]] && [[ "$MAVEN_DEPLOY_ENABLED" == "true" ]] && [[ "$MAVEN_DEPLOY_SNAPSHOT_WITH_SLUG_ENABLED" == "true" ]]
if [[ -z "$CI_COMMIT_TAG" ]] && [[ "$MAVEN_DEPLOY_ENABLED" == "true" ]] && [[ "$MAVEN_DEPLOY_SNAPSHOT_WITH_SLUG_ENABLED" == "true" ]]
then
# check if on non-prod branch
prod_ref_expr=${PROD_REF#/}
prod_ref_expr=${prod_ref_expr%/}
if [[ ! "$CI_COMMIT_BRANCH" =~ $prod_ref_expr ]]
if [[ ! "$CI_COMMIT_REF_NAME" =~ $prod_ref_expr ]]
then
# shellcheck disable=SC2086
pom_version=$(mvn $MAVEN_CLI_OPTS $mvn_settings_opt $java_proxy_args help:evaluate -Dexpression=project.version -q -DforceStdout | tail -n 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment