|
|
@ -63,8 +63,6 @@ schema_all.pdf: |
|
|
|
|
|
|
|
# Deploy to current *mamweb-test* directory
|
|
|
|
deploy_test: |
|
|
|
@if [ ${USER} != "mam-web" ]; then echo "Only possible by user mam-web"; exit 1; fi |
|
|
|
@if [ `readlink -f .` != "/aux/akce/mam/www/mamweb-test" ]; then echo "Only possible in directory mamweb-test"; exit 1; fi |
|
|
|
@echo "Installing version from origin/test ..." |
|
|
|
git pull origin test |
|
|
|
git clean -f |
|
|
@ -79,8 +77,6 @@ deploy_test: |
|
|
|
|
|
|
|
# Deploy to current *mamweb-prod* directory
|
|
|
|
deploy_prod: |
|
|
|
@if [ ${USER} != "mam-web" ]; then echo "Only possible by user mam-web"; exit 1; fi |
|
|
|
@if [ `readlink -f .` != "/aux/akce/mam/www/mamweb-prod" ]; then echo "Only possible in directory mamweb-prod"; exit 1; fi |
|
|
|
@echo "Backing up production DB ..." |
|
|
|
( cd -P .. && ./backup_prod_db.sh ) |
|
|
|
@echo "Installing version from origin/master ..." |
|
|
@ -98,13 +94,10 @@ deploy_prod: |
|
|
|
|
|
|
|
# Sync test media directory with production
|
|
|
|
sync_test_media: |
|
|
|
@if [ ${USER} != "mam-web" ]; then echo "Only possible by user mam-web"; exit 1; fi |
|
|
|
@if [ `readlink -f .` != "/aux/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 |
|
|
|
|
|
|
|
# Sync test database with production database
|
|
|
|
sync_test_db: |
|
|
|
@if [ ${USER} != "mam-web" ]; then echo "Only possible by user mam-web"; exit 1; fi |
|
|
|
pg_dump mam_test > dump-test-`date +"%Y%m%d_%H%M"`.sql |
|
|
|
pg_dump -Fc mam_prod > dump-prod.sql |
|
|
|
pg_restore -c -d mam_test dump-prod.sql |
|
|
|