Merge branch 'feat/add_mvn_package' into 'master'

feat(Version): add package

See merge request gilden/ci/gitlab-ci-templates!41
This commit is contained in:
Karina Schaeffler 2022-01-28 07:32:23 +00:00
commit 740d2cfa09
2 changed files with 5 additions and 4 deletions

View File

@ -2,15 +2,15 @@
= push-tag-and-version-template
This template creates a new tag und updates the version of your project in the repository.
For more details: https://gitlab.exxcellent.de/gilden/ci/exxcellent-ssh-tool[Gilde CI/CD: exxcellent-ssh-tool].
This template creates a new tag und updates the version of your project in the repository. Additionally, the template builds a new artifact with the `mvn package` command after setting the version which then can be exported with the gitlab-ci _artifacts_ keyword and used in subsequent stages.
For more details: https://gitlab.exxcellent.de/gilden/ci/exxcellent-ssh-tool[Gilde CI/CD: exxcellent-ssh-tool].
.Variables
|===
|Name |Description | Default Value
|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. Additionally creates a new artifact with the `mvn package` command which can be exported within the _artifacts_ section | "true"
|MVN_EXTRA_ARGS | sets extra args which will be added behind the `mvn` command | ""
|===

View File

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