Verified Commit fd9490f2 authored by anarcat's avatar anarcat
Browse files

Merge branch 'environments'

parents 334ed2af d9492e1c
Pipeline #18641 passed with stages
in 37 seconds
......@@ -18,6 +18,7 @@ variables:
include:
project: tpo/tpa/ci-templates
file: static-shim-deploy.yml
ref: simplify
build:
stage: build
......@@ -40,17 +41,39 @@ pages:
only:
- merge_requests
deploy-static:
environment:
name: production
deploy-review:
stage: deploy
variables:
REMOTE_SUBDIR: public/$CI_ENVIRONMENT_SLUG
REMOTE_SUBDIR: public/$CI_PROJECT_PATH/$CI_ENVIRONMENT_SLUG
environment:
name: review/$CI_COMMIT_REF_SLUG
url: https://review.torproject.org/$CI_ENVIRONMENT_SLUG
url: https://review.torproject.org/$CI_PROJECT_PATH/$CI_ENVIRONMENT_SLUG
on_stop: stop-review
auto_stop_in: 1 week
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: never
- if: '$CI_COMMIT_BRANCH'
image: !reference [deploy-static, image]
resource_group: !reference [deploy-static, resource_group]
before_script: !reference [.prepare-deploy-static]
script: !reference [deploy-static, script]
stop-review:
environment:
name: review/$CI_COMMIT_REF_SLUG
action: stop
variables:
REMOTE_SUBDIR: public/$CI_PROJECT_PATH/$CI_ENVIRONMENT_SLUG
when: manual
stage: deploy
image: !reference [deploy-static, image]
resource_group: !reference [deploy-static, resource_group]
before_script: !reference [.prepare-deploy-static]
script:
- ssh -o UserKnownHostsFile=".ssh/known_hosts" -i ".ssh/private_key" static-gitlab-shim@static-gitlab-shim.torproject.org delete-environment $REMOTE_SUBDIR
- ssh -o UserKnownHostsFile=".ssh/known_hosts" -i ".ssh/private_key" static-gitlab-shim@static-gitlab-shim.torproject.org static-update-component
Supports Markdown
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