allow optinal releases on master if its no merge_request to allow it on forks, also adjust the workflow rules to run on release branches

ignore Gitlab user also for releases, as all protected branches are synced
This commit is contained in:
Marcel Märtens 2021-07-09 11:19:03 +02:00
parent 6efe3523d5
commit 88fb4deebf
2 changed files with 4 additions and 3 deletions

View File

@ -46,6 +46,7 @@ workflow:
- if: $CI_MERGE_REQUEST_IID
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $GITLAB_USER_ID != "8866215"
- if: $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/ && $GITLAB_USER_ID != "8866215"
include:
- local: .gitlab/CI/recompile.yml

View File

@ -2,12 +2,12 @@
.optional-release:
stage: check
rules:
- if: $CI_PIPELINE_SOURCE != "merge_request_event" || $CI_PIPELINE_SOURCE == "schedule" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/
- if: $CI_PIPELINE_SOURCE != "merge_request_event" || $CI_PIPELINE_SOURCE == "schedule" || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/
when: never
- when: manual
allow_failure: true
# Template to only run if pushes to master or a tag happened
# Template to only run if pushes to master, a version tag, or release branch happened
.release:
stage: build
rules:
@ -19,6 +19,6 @@
.release-nightly-tmp-fix-airshipper:
stage: build-nightly
rules:
- if: $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_PIPELINE_SOURCE == "schedule" && ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/)
- if: $CI_PIPELINE_SOURCE == "schedule" && ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/)
when: always
- when: never