From 3d13ae05fb15e03693a7e7a0d91be2df79db0b6b Mon Sep 17 00:00:00 2001 From: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> Date: Tue, 13 Dec 2022 16:34:50 +0100 Subject: [PATCH] [ci] Add variable to disable selected jobs (#1986) * [ci] Add variable to disable selected jobs * apply suggestion Co-authored-by: parity-processbot <> --- .gitlab-ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8aa59eb3bd6..51becc0f8f9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -95,9 +95,14 @@ variables: - if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs +.job-switcher: + before_script: + - if echo "$CI_DISABLED_JOBS" | grep -xF "$CI_JOB_NAME"; then echo "The job has been cancelled in CI settings"; exit 0; fi + .docker-env: image: "${CI_IMAGE}" before_script: + - !reference [.job-switcher, before_script] - rustup show - cargo --version - rustup +nightly show @@ -108,6 +113,8 @@ variables: .kubernetes-env: image: "${CI_IMAGE}" + before_script: + - !reference [.job-switcher, before_script] tags: - kubernetes-parity-build