Updraven deploy_prod pro gimliho.
This commit is contained in:
parent
f6a6bdd715
commit
3879f577d0
1 changed files with 5 additions and 5 deletions
10
Makefile
10
Makefile
|
@ -79,8 +79,8 @@ deploy_test:
|
|||
|
||||
# Deploy to current *mamweb-prod* directory
|
||||
deploy_prod:
|
||||
@if [ ${USER} != "www-mam" ]; 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 [ ${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
|
||||
@echo "Backing up production DB ..."
|
||||
( cd .. && ./backup_prod_db.sh )
|
||||
@echo "Installing version from origin/master ..."
|
||||
|
@ -91,8 +91,8 @@ deploy_prod:
|
|||
./manage.py collectstatic --noinput
|
||||
(chown -R :mam . || true )
|
||||
(chmod -R g+rX,go-w . || true )
|
||||
@echo Notifying apache about the change ...
|
||||
touch mamweb/wsgi.py
|
||||
@echo Restarting systemd user unit for MaM web
|
||||
systemctl --user restart mamweb-prod
|
||||
@echo Done.
|
||||
|
||||
|
||||
|
@ -124,7 +124,7 @@ sync_local_media:
|
|||
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'` \
|
||||
./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_local: sync_media sync_db
|
||||
|
|
Loading…
Reference in a new issue