diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e8fc2bc88e638ddb4916e5bb11d37eadbe661df2..2956a16cfd50e16dec12cc1f8ba54a28f777d7ba 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -157,24 +157,24 @@ upgrade: .infra fork: stage: network up rules: - # Run on scheduled jobs - - if: '$CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == "master"' + # Run on scheduled jobs OR when `test-ci` label is assigned + - if: '($CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == "master") || $CI_MERGE_REQUEST_LABELS =~ "test-ci::infra"' allow_failure: false # Abstract for jobs responsible for creating infrastructure .infra create: rules: - # Run on scheduled jobs - - if: '$CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == "master"' + # Run on scheduled jobs OR when `test-ci` label is assigned + - if: '($CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == "master") || $CI_MERGE_REQUEST_LABELS =~ "test-ci::infra"' # skip job when branch name starts with "hotfix" or "patch" - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^(hotfix|patch)/' when: never -# Abstract for jobs responsible for cleaning up infrastructure +# Abstract for jobs responsible for cleaning up infrastructure OR when `test-ci` label is assigned .infra cleanup: rules: # Run on scheduled jobs - - if: '$CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == "master"' + - if: '($CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == "master") || $CI_MERGE_REQUEST_LABELS =~ "test-ci::infra"' allow_failure: true when: always