Merge branch 'feat/add_mvn_extra_args' into 'master'

Feat/add mvn extra args

See merge request gilden/ci/gitlab-ci-templates!39
This commit is contained in:
Marcel Feix 2021-12-07 13:22:07 +00:00
commit 59a127b118
2 changed files with 3 additions and 1 deletions

View File

@ -11,6 +11,7 @@ For more details: https://gitlab.exxcellent.de/gilden/ci/exxcellent-ssh-tool[Gil
|Name |Description | Default Value |Name |Description | Default Value
|ARTIFACT | the name of the artifact the new version is written to by the `set-version` job |"version" |ARTIFACT | the name of the artifact the new version is written to by the `set-version` job |"version"
|MVN_VERSION | defines if the `mvn version:set` command will be run | "true" |MVN_VERSION | defines if the `mvn version:set` command will be run | "true"
|MVN_EXTRA_ARGS | sets extra args which will be added behind the `mvn` command | ""
|=== |===
.push-tag-and-version-template .push-tag-and-version-template

View File

@ -4,6 +4,7 @@
variables: variables:
ARTIFACT: "version" ARTIFACT: "version"
MVN_VERSION: "false" MVN_VERSION: "false"
MVN_EXTRA_ARGS: ""
before_script: before_script:
- setup-ssh - setup-ssh
script: script:
@ -15,6 +16,6 @@
- curl "https://img.shields.io/static/v1?label=Version-&message=$VERSION&color=green" -o $ARTIFACT.svg - curl "https://img.shields.io/static/v1?label=Version-&message=$VERSION&color=green" -o $ARTIFACT.svg
- > - >
if [ "${MVN_VERSION}" == "true" ]; then if [ "${MVN_VERSION}" == "true" ]; then
mvn versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false mvn $MVN_EXTRA_ARGS versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false
fi fi
- push $VERSION - push $VERSION