Commit 93df51c7 authored by Andrew Okin's avatar Andrew Okin

Add job to stop branch environments

parent 9db7eaac
Pipeline #30 passed with stages
in 53 seconds
......@@ -57,10 +57,24 @@ deploy_branch:
environment:
name: branch/$CI_COMMIT_REF_NAME
url: https://test.forkk.net/branch/$CI_COMMIT_REF_SLUG
on_stop: stop_branch
script:
- echo "$SSH_TEST_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- rsync -a --delete _site/ "$SSH_BRANCH_DEPLOY_DEST/$CI_COMMIT_REF_SLUG"
stop_branch:
extends: .deploy
dependencies: []
when: manual
variables:
GIT_STRATEGY: none
environment:
name: branch/$CI_COMMIT_REF_NAME
action: stop
script:
- echo "$SSH_TEST_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- ssh "$SSH_BRANCH_DEPLOY_HOST" "rm -r $SSH_BRANCH_DEPLOY_PATH/$CI_COMMIT_REF_SLUG"
.deploy:
stage: deploy
dependencies:
......
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