Skip to content
Snippets Groups Projects
Commit 33f41dbf authored by Andreas Nüßlein's avatar Andreas Nüßlein
Browse files

enable CI/CD for production

parent a45c0ab6
Branches
No related tags found
No related merge requests found
......@@ -67,20 +67,25 @@ deploy to staging:
only:
- main
#deploy to production:
# stage: deploy
# script:
# - eval $(ssh-agent -s)
# - echo "$PRODUCTION_SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
# - |
# ssh $PRODUCTION_USER@$PRODUCTION_HOST << E=O=F
# set -e
# mv maintenance.html_ maintenance.html || echo "could not move maintenance"
# cd ~/htdocs
# poetry run doit full_update production=True branch=production
# sudo /bin/systemctl restart webapp-qcat.wocat.net.service
# cd ~
# mv maintenance.html maintenance.html_
# E=O=F
# only:
# - production
deploy to production:
stage: deploy
script:
- apt update
- apt install openssh-client -y
- eval $(ssh-agent -s)
- echo "$PRODUCTION_SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- |
ssh -o StrictHostKeyChecking=no $PRODUCTION_USER@$PRODUCTION_HOST << E=O=F
set -e
mv maintenance.html_ maintenance.html || echo "could not move maintenance"
cd ~/htdocs
git pull
git switch production
poetry install
poetry run doit update
sudo /bin/systemctl restart webapp-wocat.net.service
cd ~
mv maintenance.html maintenance.html_
E=O=F
only:
- production
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment