Gitlab doesn’t recognize stop action for environment
I have CICD Config, which creates an environment. However, the on_stop
action doesn’t properly get recognized by gittlab (selfhosted 14.9.2).
stages:
- deploy
deploy_test:
image: #myimage
stage: deploy
environment:
name: test
url: #myurl
on_stop: stop_test
rules:
- if: '$CI_COMMIT_BRANCH == "mybranch" && $CI_PIPELINE_SOURCE != "merge_request_event"'
script: #myscript
stop_test:
stage: deploy
variables:
GIT_STRATEGY: none
script: #myscript
when: manual
environment:
name: test
action: stop
When I try to stop the environment via the GUI, it tells me that there is “no “stop environment action” being defined in the .gitlab-ci.yml file.”.
However, I can select stop_test
as a possible “deployment target”:
Any ideas on what I’m doing wrong here?
Thanks!