gitlab-ci-training icon indicating copy to clipboard operation
gitlab-ci-training copied to clipboard

Add skip jobs using variables example (rules)

Open ondrejsika opened this issue 3 years ago • 0 comments

stages:
  - build
  - test
  - deploy

build:
  stage: build
  script: echo Build
  except:
    variables:
      - $SKIP_STAGE_build == "1" && $SKIP_BRANCH == $CI_COMMIT_REF_NAME

test:
  stage: test
  script: echo Test
  except:
    variables:
      - $SKIP_STAGE_test == "1" && $SKIP_BRANCH == $CI_COMMIT_REF_NAME

deploy:
  stage: deploy
  script: echo Deploy
  except:
    variables:
      - $SKIP_STAGE_deploy == "1" && $SKIP_BRANCH == $CI_COMMIT_REF_NAME

ondrejsika avatar Nov 09 '21 09:11 ondrejsika