Commit fce6a2f4 authored by Isabella Skořepová's avatar Isabella Skořepová

Upload to cloud.ok1kvk.cz as well as ok1kvk.cz

parent eb4e9799
Pipeline #476 failed with stage
in 50 seconds
# env vars:
# - PREVIEW_SSH_KEY
preview:
variables:
HTML_DIR: "/var/www/html/preview.ok1kvk.cz"
......@@ -12,15 +14,20 @@ preview:
- mkdir -p fake_static
- cd generator/; npm install; cd ..
- node generator/index.js --baseurl /$CI_BUILD_REF_NAME --contentdir . --staticdir fake_static --themedir generator/theme --builddir build --noserver
- echo "$SSH_KEY" > sshkey
- 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 ln -fs $HTML_DIR/static/static $HTML_DIR/static/$CI_BUILD_REF_NAME
- rm sshkey
# Needs following env var: LFTP_PASSWORD
# Needs following env vars:
# - LFTP_PASSWORD
# - DEPLOY_SSH_KEY
deploy:
environment: deployment
variables:
HTML_DIR: "/html/www"
SSH_HOST: "uploader@cloud.ok1kvk.cz"
only:
- master
script:
......@@ -30,6 +37,9 @@ deploy:
- if [ -d static ] ; then cd static; git pull; cd ..; else git clone https://git.ok1kvk.cz/ok1kvk.cz/static.git; fi
- cd generator/; npm install; cd ..
- node generator/index.js --contentdir . --staticdir static --themedir generator/theme --builddir build --noserver
- echo "$DEPLOY_SSH_KEY" > sshkey
- rsync -e 'ssh -i sshkey' -rc --delete build/ $SSH_HOST:$HTML_DIR/
- rm sshkey
- generator/upload
cache:
......
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