gilde-ci-cd/push-tag-and-version-template.gitlab-ci.yml
Fabian Widmann 70f0f24b5d Merge branch 'feat/branching_fixes' into 'master'
Feat/branching fixes

See merge request gilden/ci/gitlab-ci-templates!12
2021-07-16 11:21:46 +00:00

21 lines
649 B
YAML

.push-tag-and-version:
stage: push-tag-and-version
image: gitlab.exxcellent.de:4567/gilden/ci/exxcellent-ssh-tool:1.2.0
variables:
ARTIFACT: "version"
MVN_VERSION: "false"
before_script:
- setup-ssh
script:
- export VERSION="0.0.0"
- "[ -f ./$ARTIFACT ] && export VERSION=$(cat ./$ARTIFACT)"
- echo $VERSION
- pull
- echo $VERSION > $ARTIFACT
- curl "https://img.shields.io/static/v1?label=Version-&message=$VERSION&color=green" -o $ARTIFACT.svg
- >
if [ "${MVN_VERSION}" == "true" ]; then
mvn versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false
fi
- push $VERSION