Update .gitlab-ci.yml file -- releases only for master and for valid tag format

merge-requests/1/merge
ansgarz 3 years ago
parent 1ea82db32e
commit abb93ebb13

@ -71,10 +71,13 @@ publish:
fatjar: fatjar:
stage: fatjar stage: fatjar
rules: rules:
- if: $CI_COMMIT_TAG # Do no allow manually triggered pipelines to prevent duplicates!
only: # Instead rerun the pipeline created with the last push
refs: - if: $CI_PIPELINE_SOURCE != "push"
- master when: never
# Only execute when a valid version tag like v1.0, 2.3 or similar is given
# Required is always one point like 1.0
- if: $CI_COMMIT_REF_NAME == "master" && $CI_COMMIT_TAG =~ /^v?[0-9]+[.][0-9]+([.][0-9]+)?$/
before_script: before_script:
- echo $CI_JOB_ID - echo $CI_JOB_ID
# Writing FATJAR_JOB_ID variable to environment file, as variable is needed in the release stage. # Writing FATJAR_JOB_ID variable to environment file, as variable is needed in the release stage.
@ -94,10 +97,13 @@ fatjar:
release: release:
stage: release stage: release
rules: rules:
- if: $CI_COMMIT_TAG # Run this job when a git tag is created manually # Do no allow manually triggered pipelines to prevent duplicates!
only: # Instead rerun the pipeline created with the last push
refs: - if: $CI_PIPELINE_SOURCE != "push"
- master when: never
# Only execute when a valid version tag like v1.0, 2.3 or similar is given
# Required is always one point like 1.0
- if: $CI_COMMIT_REF_NAME == "master" && $CI_COMMIT_TAG =~ /^v?[0-9]+[.][0-9]+([.][0-9]+)?$/
needs: needs:
- job: fatjar - job: fatjar
artifacts: true artifacts: true

Loading…
Cancel
Save