Commit e66d9bfb authored by Sandro Lutz's avatar Sandro Lutz
Browse files

Add GitLab-CI deploy script

parent e6bc2aea
Pipeline #2673 skipped with stage
stages:
- deploy
dev_deploy:
stage: deploy
image: alpine:latest
when: manual
before_script:
- 'which ssh-agent || ( apk update -y && apk add openssh-client -y )'
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- echo "$DEPLOY_PRIVATE_KEY" | ssh-add -
- 'which rsync || ( apk add rsync -y )'
script:
- ssh -p22 amivburger@login.ee.ethz.ch "mkdir -p ~/app_tmp/"
- rsync -rav -e ssh --exclude='.git/' --exclude='.gitlab-ci.yml' --delete-excluded ./ amivburger@login.ee.ethz.ch:~/app_tmp
- ssh -p22 amivburger@login.ee.ethz.ch "cp ~/app/app/config.py ~/app_tmp/app/"
- ssh -p22 amivburger@login.ee.ethz.ch "mv ~/app ~/app_old && mv ~/app_tmp ~/app && chmod -R 700 ~/app"
- ssh -p22 amivburger@login.ee.ethz.ch "touch ~/app-touch-reload.gg"
- ssh -p22 amivburger@login.ee.ethz.ch "rm -rf ~/app_old"
environment:
name: production
url: https://burger.amiv.ethz.ch
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