Closed miekg closed 1 year ago
stop_review:
script:
- ./teardown-environment
when: manual
environment:
name: review/$CI_COMMIT_REF_SLUG
action: stop
action: stop
?
you can just set this up in a .gitlab-ci.yml
deploy_production:
resource_group: production
stage: deploy
environment:
name: production
url: https://example.com
on_stop: stop_production
script:
- echo hallo
when: manual
stop_production:
resource_group: production
stage: deploy
script:
- echo "Delete the resources"
environment:
name: production
action: stop
when: manual
with script
you can do with you want. So I propose we let pgoctl get a SSH key via the environment, and set up a variable in gitlab with an ssh pubkey as value, so you can also just use pgoctl from there.
(need to make simple deb package out of it, but that's trivail)
btw URL give you live view of production, which may or may not be your website
documented in the README on how to do this
Reading https://gitlab.science.ru.nl/help/ci/environments/index.md and playing with it, it seems to boil down on the URL that you can configure. If you put some kind of token in there and you can verify this on the pgo endpoint (same as with ssh ), ie.
?token=aaaa?name=xxxx?deploy
have to check what gitlab actually sends towards the endpoint, because how do you stop a deployment, vs starting it? Or should you toggle the state