Browse Source

Updraven deploy_prod pro gimliho.

remotes/origin/master
parent
commit
3879f577d0
  1. 10
      Makefile

10
Makefile

@ -79,8 +79,8 @@ deploy_test:
# Deploy to current *mamweb-prod* directory # Deploy to current *mamweb-prod* directory
deploy_prod: deploy_prod:
@if [ ${USER} != "www-mam" ]; then echo "Only possible by user www-mam"; exit 1; fi @if [ ${USER} != "mam-web" ]; then echo "Only possible by user www-mam"; exit 1; fi
@if [ `pwd` != "/akce/MaM/WWW/mamweb-prod" ]; then echo "Only possible in /akce/MaM/WWW/mamweb-prod"; exit 1; fi @if [ `pwd` != "/akce/mam/www/mamweb-prod" ]; then echo "Only possible in /akce/mam/www/mamweb-prod"; exit 1; fi
@echo "Backing up production DB ..." @echo "Backing up production DB ..."
( cd .. && ./backup_prod_db.sh ) ( cd .. && ./backup_prod_db.sh )
@echo "Installing version from origin/master ..." @echo "Installing version from origin/master ..."
@ -91,8 +91,8 @@ deploy_prod:
./manage.py collectstatic --noinput ./manage.py collectstatic --noinput
(chown -R :mam . || true ) (chown -R :mam . || true )
(chmod -R g+rX,go-w . || true ) (chmod -R g+rX,go-w . || true )
@echo Notifying apache about the change ... @echo Restarting systemd user unit for MaM web
touch mamweb/wsgi.py systemctl --user restart mamweb-prod
@echo Done. @echo Done.
@ -124,7 +124,7 @@ sync_local_media:
sync_local_db: sync_local_db:
scp www-mam@atrey.karlin.mff.cuni.cz:`ssh www-mam@atrey.karlin.mff.cuni.cz 'ls -v /akce/MaM/WWW/backups/mam-prod-*\.pgdump | tail -n 1'` \ scp www-mam@atrey.karlin.mff.cuni.cz:`ssh www-mam@atrey.karlin.mff.cuni.cz 'ls -v /akce/MaM/WWW/backups/mam-prod-*\.pgdump | tail -n 1'` \
./last.pgdump ./last.pgdump
pg_restore -c -d mam -U mam last.pgdump pg_restore -c -d mam_prod last.pgdump
# Sync database and media. See above lines # Sync database and media. See above lines
sync_local: sync_media sync_db sync_local: sync_media sync_db

Loading…
Cancel
Save