From 7b0497a1d28f276d443d1578a819210df9b28bd1 Mon Sep 17 00:00:00 2001 From: Tomas Gavenciak Date: Fri, 25 Sep 2015 08:30:28 +0200 Subject: [PATCH] Update guardu u make deploy_* --- Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 01f7790a..1887b99b 100644 --- a/Makefile +++ b/Makefile @@ -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.