Gitlab: .gitlab-ci.yml to get triggered manually and after checking variable name only
Pipeline to be triggered only when:
1. STAGE variable input equals PIPELINE and
2. Pipeline in manually triggered
Below is the code for .gitlab-ci.yml
variables:
STAGE:
value: ''
description: 'Enter PIPELINE here!'
job build:
stage: build
script:
- chmod +x $CI_PROJECT_DIR/scripts/hello.sh
- $CI_PROJECT_DIR/scripts/hello.sh
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
- if: '$STAGE == "PIPELINE"'
Comments
Post a Comment