Skip to content
Snippets Groups Projects
Unverified Commit 5df22e7e authored by Isabella Skořepová's avatar Isabella Skořepová
Browse files

Delete preview as it does not work anyway

parent 84ce937c
No related branches found
No related tags found
No related merge requests found
image: node:8
image: node:12
stages:
- preview
- deployment
# 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:
name: preview/$CI_BUILD_REF_NAME
url: https://preview.ok1kvk.cz/$CI_BUILD_REF_NAME
on_stop: stop_preview
except:
- master
script:
- node --version
- rm -rf build
- mkdir -p fake_static
- npm ci
- node ./index.js --baseurl /$CI_BUILD_REF_NAME --contentdir . --staticdir fake_static --themedir theme --builddir build --noserver
- echo "$PREVIEW_SSH_KEY" > sshkey
- chmod 600 sshkey
- rsync -e 'ssh -i sshkey' -rc --delete build/ $SSH_HOST:$HTML_DIR/$CI_BUILD_REF_NAME/
- ssh -i sshkey $SSH_HOST git -C $HTML_DIR/static/static/ pull
- ssh -i sshkey $SSH_HOST cp -asf $HTML_DIR/static/static/articles/. $HTML_DIR/$CI_BUILD_REF_NAME/clanek/
- ssh -i sshkey $SSH_HOST ln -sf $HTML_DIR/static/static/images/ $HTML_DIR/$CI_BUILD_REF_NAME/
- rm sshkey
stop_preview:
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: preview/$CI_BUILD_REF_NAME
action: stop
except:
- master
# Needs following env vars:
# - LFTP_PASSWORD
# - DEPLOY_SSH_KEY
deploy:
tags:
- docker
stage: deployment
environment: deployment
variables:
HTML_DIR: "/html/www"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment