Commit 690fae31 authored by Isabella Skořepová's avatar Isabella Skořepová

Update .gitlab-ci.yml to use review app

parent 3425b412
Pipeline #489 failed
# env vars:
# - PREVIEW_SSH_KEY
preview:
stage: preview
variables:
HTML_DIR: "/var/www/html/preview.ok1kvk.cz"
SSH_HOST: "preview-ok1kvk-cz@alfa.ok1kvk.cz"
environment: preview
environment:
name: preview/$CI_BUILD_REF_NAME
url: https://preview.ok1kvk.cz/$CI_BUILD_REF_NAME
on_stop: stop_review
except:
- master
script:
......@@ -19,6 +23,21 @@ preview:
- rsync -e 'ssh -i sshkey' -rc --delete build/ $SSH_HOST:$HTML_DIR/$CI_BUILD_REF_NAME/
- ssh -i sshkey $SSH_HOST ln -fs $HTML_DIR/static/static $HTML_DIR/static/$CI_BUILD_REF_NAME
- rm sshkey
stop_review:
stage: preview
variables:
HTML_DIR: "/var/www/html/preview.ok1kvk.cz"
SSH_HOST: "preview-ok1kvk-cz@alfa.ok1kvk.cz"
script:
- echo "$PREVIEW_SSH_KEY" > sshkey
- chmod 600 sshkey
- ssh -i sshkey $SSH_HOST "rm -rf $HTML_DIR/$CI_BUILD_REF_NAME/"
- rm sshkey
when: manual
environment:
name: review/$CI_BUILD_REF_NAME
action: stop
# Needs following env vars:
# - LFTP_PASSWORD
......
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