Update guardu u make deploy_*

This commit is contained in:
Tomas Gavenciak 2015-09-25 08:30:28 +02:00
parent c0607297c7
commit 7b0497a1d2

View file

@ -60,7 +60,8 @@ schema_all.pdf:
# Deploy to current *mamweb-test* directory
deploy_test:
@if [[ `pwd` != "/akce/MaM/WWW/mamweb-test" ]]; then echo "Only possible in /akce/MaM/WWW/mamweb-test"; exit 1; fi
@if [ ${USER} != "www-mam" ]; then echo "Only possible by user www-mam"; exit 1; fi
@if [ `pwd` != "/akce/MaM/WWW/mamweb-test" ]; then echo "Only possible in /akce/MaM/WWW/mamweb-test"; exit 1; fi
@echo "Installing version from origin/master ..."
git pull origin master
git clean -f
@ -68,13 +69,15 @@ deploy_test:
./manage.py migrate
./manage.py collectstatic --noinput
(chown -Rf :mam . || true )
(chmod -Rf g+rwX . || true )
(chmod -Rf g+rX . || true )
(chmod -Rf g+rwX ./media/ || true )
touch mamweb/wsgi.py
@echo Done.
# Deploy to current *mamweb-prod* directory
deploy_prod:
@if [[ `pwd` != "/akce/MaM/WWW/mamweb-prod" ]]; then echo "Only possible in /akce/MaM/WWW/mamweb-prod"; exit 1; fi
@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
@echo "Backing up production DB ..."
( cd .. && ./backup_prod_db.sh )
@echo "Installing version from origin/stable ..."
@ -84,7 +87,8 @@ deploy_prod:
./manage.py migrate
./manage.py collectstatic --noinput
(chown -Rf :mam . || true )
(chmod -Rf g+rwX . || true )
(chmod -Rf g+rX . || true )
(chmod -Rf g+rwX ./media/ || true )
touch mamweb/wsgi.py
@echo Done.