As per
https://docs.gitlab.com/ee/ci/environments.html#viewing-environments-and-deployments
and,
https://docs.gitlab.com/ee/ci/yaml/#environment
In the example where we STOP an environment, the following text is quoted:
Setting the
GIT_STRATEGY
tonone
is necessary in thestop_review
job so that the GitLab Runner won’t try to check out the code after the branch is deleted.
Also in the example,
GIT_STRATEGY
is set tonone
so that GitLab Runner won’t try to check out the code after the branch is deleted when thestop_review_app
job is automatically triggered.
It does this in the STOP ENV job:
stop_review:
stage: deploy
variables:
GIT_STRATEGY: none <<<< THIS
script:
- echo "Remove review app"
when: manual
environment:
name: review/$CI_COMMIT_REF_NAME
action: stop
However, what if our STOP ENV job depends on global variables
? Setting this in the job will OVERWRITE the global variables.
https://docs.gitlab.com/ee/ci/yaml/#variables
When the
variables
keyword is used on a job level, it overrides the global YAML variables and predefined ones.
Is there no way to control the GIT strategy without wiping all global variables?