Browse Source

SMAZAT: Upravy pro upgrade

middleware_test
Pavel Turinsky (VM) 4 years ago
parent
commit
4dba5919de
  1. 7
      Makefile
  2. 9
      mamweb/settings_prod.py

7
Makefile

@ -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

9
mamweb/settings_prod.py

@ -28,7 +28,8 @@ DEBUG = False
TEMPLATE_DEBUG = False
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
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
@ -37,7 +38,7 @@ DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'mam_prod',
'USER': 'mam-web',
'USER': 'user',
'TEST': {
'NAME': 'mam-prod-testdb',
},
@ -46,8 +47,8 @@ DATABASES = {
import os
SERVER_EMAIL = 'mamweb-prod-errors@mam.mff.cuni.cz'
ADMINS = [('M&M ERRORs', 'mam-errors@mam.mff.cuni.cz')]
SERVER_EMAIL = 'mamweb-prod-errors@pokemon.ledoian.cz'
ADMINS = [('M&M ERRORs', 'mam-errors@pokemon.ledoian.cz')]
# SECURITY: only send sensitive cookies via HTTPS

Loading…
Cancel
Save