ci/deploy: Pull code instead of push

This commit is contained in:
Daan Sprenkels
2019-03-29 15:29:59 +01:00
parent 576ed475f1
commit 8bc3a288ee

View File

@ -29,16 +29,13 @@ deploy:
marietje-zuid.science.ru.nl ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLticd8NEr6r5QJ2VKFX/rVcfkhM3IcAr+hCgc/kgBSIPEzyRIXd74glIx17FJxvhi2KLC5D+EVtu9CSZhYSe10=
EOF
# Upload to marietje-zuid
git push root@marietje-zuid.science.ru.nl:/srv/MarietjeDjango marietje-zuid
# Deploy the new version
cat <<EOF | ssh root@marietje-zuid.science.ru.nl
readonly PYTHON="/srv/MarietjeDjango/django_env/bin/python"
readonly MANAGE="/srv/MarietjeDjango/marietje/manage.py"
systemctl stop MarietjeDjango.service
git --git-dir=/srv/MarietjeDjango/.git merge marietje-zuid
git --git-dir=/srv/MarietjeDjango/.git pull origin marietje-zuid
"$PYTHON" "$MANAGE" migrate --noinput
"$PYTHON" "$MANAGE" collectstatic --noinput
systemctl start MarietjeDjango.service