Commit 1c29a51d authored by Olav Morken's avatar Olav Morken

GitLab CI: Remove module from environments when branch is deleted

This patch adjusts the GitLab CI configuration file to automatically
remove the module from a Puppet environment when the corresponding
branch is deleted. This only works through the new Puppet
configuration services.
parent 570d1c0f
Pipeline #10394 passed with stages
in 57 seconds
......@@ -14,11 +14,40 @@ test:
only:
- branches
upload:
upload-production:
stage: upload
script:
- /puppet-deploy-scripts/pmodule_upload.sh
environment:
name: production
only:
- master
upload-branch:
stage: upload
script:
- /puppet-deploy-scripts/pmodule_upload.sh
environment:
name: $CI_BUILD_REF_NAME
on_stop: delete-branch
only:
- branches
except:
- master
- tags
delete-branch:
stage: upload
variables:
GIT_STRATEGY: none
script:
- /puppet-deploy-scripts/delete.sh "${CI_PROJECT_NAME}" "${CI_BUILD_REF_NAME}" "${CI_COMMIT_SHA}"
environment:
name: $CI_BUILD_REF_NAME
action: stop
when: manual
only:
- /^[a-z0-9_]+$/
except:
- master
- tags
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment