|
@ -63,8 +63,8 @@ schema_all.pdf: |
|
|
|
|
|
|
|
|
# Deploy to current *mamweb-test* directory
|
|
|
# Deploy to current *mamweb-test* directory
|
|
|
deploy_test: |
|
|
deploy_test: |
|
|
@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 mam-web"; exit 1; fi |
|
|
@if [ `pwd` != "/akce/MaM/WWW/mamweb-test" ]; then echo "Only possible in /akce/MaM/WWW/mamweb-test"; 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/test ..." |
|
|
@echo "Installing version from origin/test ..." |
|
|
git pull origin test |
|
|
git pull origin test |
|
|
git clean -f |
|
|
git clean -f |
|
@ -73,13 +73,13 @@ deploy_test: |
|
|
./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 unit |
|
|
touch mamweb/wsgi.py |
|
|
systemctl --user restart mamweb-test.service |
|
|
@echo Done. |
|
|
@echo Done. |
|
|
|
|
|
|
|
|
# Deploy to current *mamweb-prod* directory
|
|
|
# Deploy to current *mamweb-prod* directory
|
|
|
deploy_prod: |
|
|
deploy_prod: |
|
|
@if [ ${USER} != "mam-web" ]; then echo "Only possible by user www-mam"; exit 1; fi |
|
|
@if [ ${USER} != "mam-web" ]; then echo "Only possible by user mam-web"; 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 ) |
|
@ -92,22 +92,22 @@ deploy_prod: |
|
|
(chown -R :mam . || true ) |
|
|
(chown -R :mam . || true ) |
|
|
(chmod -R g+rX,go-w . || true ) |
|
|
(chmod -R g+rX,go-w . || true ) |
|
|
@echo Restarting systemd user unit for MaM web |
|
|
@echo Restarting systemd user unit for MaM web |
|
|
systemctl --user restart mamweb-prod |
|
|
systemctl --user restart mamweb-prod.service |
|
|
@echo Done. |
|
|
@echo Done. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Sync test media directory with production
|
|
|
# Sync test media directory with production
|
|
|
sync_test_media: |
|
|
sync_test_media: |
|
|
@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 mam-web"; exit 1; fi |
|
|
@if [ `pwd` != "/akce/MaM/WWW/mamweb-test" ]; then echo "Only possible in /akce/MaM/WWW/mamweb-test"; exit 1; fi |
|
|
@if [ `pwd` != "/akce/mam/www/mamweb-test" ]; then echo "Only possible in /akce/mam/www/mamweb-test"; exit 1; fi |
|
|
rsync -av --delete /akce/MaM/WWW/mamweb-prod/media/ ./media |
|
|
rsync -av --delete /akce/mam/www/mamweb-prod/media/ ./media |
|
|
|
|
|
|
|
|
# Sync test database with production database
|
|
|
# Sync test database with production database
|
|
|
sync_test_db: |
|
|
sync_test_db: |
|
|
@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 mam-web"; exit 1; fi |
|
|
pg_dump mam-test -U mam > dump-test-`date +"%Y%m%d_%H%M"`.sql |
|
|
pg_dump mam_test > dump-test-`date +"%Y%m%d_%H%M"`.sql |
|
|
pg_dump -Fc mam-prod -U mam > dump-prod.sql |
|
|
pg_dump -Fc mam_prod > dump-prod.sql |
|
|
pg_restore -c -d mam-test -U mam dump-prod.sql |
|
|
pg_restore -c -d mam_test dump-prod.sql |
|
|
rm dump-prod.sql |
|
|
rm dump-prod.sql |
|
|
@echo Done. |
|
|
@echo Done. |
|
|
|
|
|
|
|
|