SMAZAT: Upravy pro upgrade
This commit is contained in:
parent
b7ceef2747
commit
4dba5919de
2 changed files with 5 additions and 11 deletions
7
Makefile
7
Makefile
|
@ -63,8 +63,6 @@ schema_all.pdf:
|
||||||
|
|
||||||
# Deploy to current *mamweb-test* directory
|
# Deploy to current *mamweb-test* directory
|
||||||
deploy_test:
|
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 ..."
|
@echo "Installing version from origin/test ..."
|
||||||
git pull origin test
|
git pull origin test
|
||||||
git clean -f
|
git clean -f
|
||||||
|
@ -79,8 +77,6 @@ deploy_test:
|
||||||
|
|
||||||
# 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 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 ..."
|
@echo "Backing up production DB ..."
|
||||||
( cd -P .. && ./backup_prod_db.sh )
|
( cd -P .. && ./backup_prod_db.sh )
|
||||||
@echo "Installing version from origin/master ..."
|
@echo "Installing version from origin/master ..."
|
||||||
|
@ -98,13 +94,10 @@ deploy_prod:
|
||||||
|
|
||||||
# Sync test media directory with production
|
# Sync test media directory with production
|
||||||
sync_test_media:
|
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
|
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} != "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 mam_test > dump-test-`date +"%Y%m%d_%H%M"`.sql
|
||||||
pg_dump -Fc mam_prod > dump-prod.sql
|
pg_dump -Fc mam_prod > dump-prod.sql
|
||||||
pg_restore -c -d mam_test dump-prod.sql
|
pg_restore -c -d mam_test dump-prod.sql
|
||||||
|
|
|
@ -28,7 +28,8 @@ DEBUG = False
|
||||||
TEMPLATE_DEBUG = False
|
TEMPLATE_DEBUG = False
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['mam.mff.cuni.cz', 'www.mam.mff.cuni.cz', 'atrey.karlin.mff.cuni.cz',
|
ALLOWED_HOSTS = ['mam.mff.cuni.cz', 'www.mam.mff.cuni.cz', 'atrey.karlin.mff.cuni.cz',
|
||||||
'mamweb.bezva.org','gimli.ms.mff.cuni.cz']
|
'mamweb.bezva.org','gimli.ms.mff.cuni.cz',
|
||||||
|
'localhost']
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
|
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
|
||||||
|
@ -37,7 +38,7 @@ DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||||
'NAME': 'mam_prod',
|
'NAME': 'mam_prod',
|
||||||
'USER': 'mam-web',
|
'USER': 'user',
|
||||||
'TEST': {
|
'TEST': {
|
||||||
'NAME': 'mam-prod-testdb',
|
'NAME': 'mam-prod-testdb',
|
||||||
},
|
},
|
||||||
|
@ -46,8 +47,8 @@ DATABASES = {
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
SERVER_EMAIL = 'mamweb-prod-errors@mam.mff.cuni.cz'
|
SERVER_EMAIL = 'mamweb-prod-errors@pokemon.ledoian.cz'
|
||||||
ADMINS = [('M&M ERRORs', 'mam-errors@mam.mff.cuni.cz')]
|
ADMINS = [('M&M ERRORs', 'mam-errors@pokemon.ledoian.cz')]
|
||||||
|
|
||||||
|
|
||||||
# SECURITY: only send sensitive cookies via HTTPS
|
# SECURITY: only send sensitive cookies via HTTPS
|
||||||
|
|
Loading…
Reference in a new issue