Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Maven
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SmartDataLab
public
CI-CD components
Maven
Commits
afcc0b0c
Commit
afcc0b0c
authored
5 months ago
by
Yanis Guérault
Committed by
Pierre Smeyers
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: add Git branch slug in SNAPSHOT versions for Merge Request
parent
d45f8d6e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/gitlab-ci-maven.yml
+2
-2
2 additions, 2 deletions
templates/gitlab-ci-maven.yml
with
2 additions
and
2 deletions
templates/gitlab-ci-maven.yml
+
2
−
2
View file @
afcc0b0c
...
@@ -576,12 +576,12 @@ stages:
...
@@ -576,12 +576,12 @@ stages:
# only on a branch commit, with deploy and "SNAPSHOT with slug" enabled
# only on a branch commit, with deploy and "SNAPSHOT with slug" enabled
function maybe_inject_slug_in_version() {
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
then
# check if on non-prod branch
# check if on non-prod branch
prod_ref_expr=${PROD_REF#/}
prod_ref_expr=${PROD_REF#/}
prod_ref_expr=${prod_ref_expr%/}
prod_ref_expr=${prod_ref_expr%/}
if [[ ! "$CI_COMMIT_
BRANCH
" =~ $prod_ref_expr ]]
if [[ ! "$CI_COMMIT_
REF_NAME
" =~ $prod_ref_expr ]]
then
then
# shellcheck disable=SC2086
# 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)
pom_version=$(mvn $MAVEN_CLI_OPTS $mvn_settings_opt $java_proxy_args help:evaluate -Dexpression=project.version -q -DforceStdout | tail -n 1)
...
...
This diff is collapsed.
Click to expand it.
Benguria Elguezabal, Gorka
@gorka.benguria
mentioned in commit
2385fdd7
·
4 months ago
mentioned in commit
2385fdd7
mentioned in commit 2385fdd7a67a63630ca3e3422a73954bdc07148c
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment