I am following the GitLab flow using Environment and deployments. I have a job, deploy_review that deploys a review app. After the branch is merged or deleted, it should trigger the stop_review job, as per the documentation.
This is my CI configuration:
stages:
- build
- deploy
- test
...
deploy_review:
stage: deploy
script:
...
environment:
name: review/$CI_COMMIT_REF_SLUG
url: https://$CI_ENVIRONMENT_SLUG.example.com
on_stop: stop_review
when: manual
stop_review:
stage: deploy
script:
...
environment:
name: review/$CI_COMMIT_REF_SLUG
action: stop
when: manual
test_sauce:
stage: test
trigger:
include: .gitlab-ci-testing.yml
variables:
EMULATE_BRANCH: $EMULATE_BRANCH
I am wondering if there's a problem if the job 'test' is preventing the stop_review: from being triggered if the branch is deleted.
Edit: I add variable GIT_STRATEGY, but still experiencing the same issue
stop_review:
stage: deploy
variables:
GIT_STRATEGY: none
script:
...
environment:
name: review/$CI_COMMIT_REF_SLUG
action: stop
when: manual