# HG changeset patch # User ymh # Date 1353027013 -3600 # Node ID 49efb495b46d5098af96830fee604dd2db87b60e # Parent 998a4f1efda1e0a582c61c3c43628c5d447cc788 try to correct config template diff -r 998a4f1efda1 -r 49efb495b46d sbin/sync/config.py.tmpl --- a/sbin/sync/config.py.tmpl Fri Nov 16 01:16:41 2012 +0100 +++ b/sbin/sync/config.py.tmpl Fri Nov 16 01:50:13 2012 +0100 @@ -1,64 +1,98 @@ from fabric.api import env -env.hosts = ['@'] +env.hosts = ['hp@54.248.83.51'] -env.web_group = '' -env.folders = ['log', 'static/media'] +env.web_group = 'nginx' +env.folders = {'ldt': ['index', 'log', 'static/media'], 'hp': ['static', 'src/log'] } env.local_folders = { - 'web': 'ldt/web', + 'ldt' : 'ldt/web', 'virtualenv': 'virtualenv', + 'hp' : 'src' +} + +env.base_export_path = "/Users/ymh/dev/tmp/hp/export" +env.export_prefix = "hp" + +env.remote_web_path = { + 'ldt' : "/ebs/ldt/web", + 'hp' : "/ebs/hp/src" } -env.base_export_path = "" -env.export_prefix = "hyperplateau" -env.remote_web_path = "" -env.platform_web_module = "hyperplateau" -env.remote_virtualenv_path = "" -env.remote_venv_export_path = "" -env.remote_baseline_venv = "" -env.web_rsync_filters = [ - "+ core", - "P .htpasswd", - "P .htaccess", - "P ldtplatform/.htaccess", - "P ldtplatform/config.py", - "P ldtplatform/modwsgi.wsgi", - "P robots.txt", - "P env/***", - "P log/***", - "P index/***", - "P static/media/***", - "P crossdomain.xml", -] +env.web_module = {'ldt':"ldtplatform", 'hp':"hp"} + +env.remote_virtualenv_path = "/ebs/ldt/virtualenv/ldt_venv" +env.remote_venv_export_path = "/tmp/ldt_venv_tmp" +env.remote_baseline_venv = "/ebs/ldt/virtualenv/baseline" + +env.web_rsync_filters = { + 'ldt': [ + "+ core", + "P .htpasswd", + "P .htaccess", + "P ldtplatform/.htaccess", + "P ldtplatform/config.py", + "P ldtplatform/modwsgi.wsgi", + "P robots.txt", + "P env/***", + "P log/***", + "P index/***", + "P static/media/***", + "P crossdomain.xml", + ], + 'hp': [ + "+ core", + "P .htpasswd", + "P .htaccess", + "P hp/.htaccess", + "P hp/config.py", + "P hp/modwsgi.wsgi", + "P robots.txt", + "P log/***", + "P index/***", + "P crossdomain.xml", + ] +} env.venv_rsync_filters = [ "+ core", ] -env.web_relaunch_cmd = "supervisorctl restart hyperplateau" -env.base_url = "/" -env.web_url = "http://" -env.stream_url = "" #optional - -env.stream_src_prefix = "" -env.ffmpeg_path = "" #optional +env.relaunch_cmd = {'ldt':"supervisorctl restart ldtplatform", 'hp':"supervisorctl restart hp"} -env.db_engine = '' #cf django documentation -env.db_name = '' -env.db_user = '' -env.db_password = '' -env.db_host = '' -env.db_port = - -env.log_file = env.remote_web_path + '/log/log.txt' +env.config = { + 'ldt': { + 'base_url': "/ldtplatform", + 'web_url': 'http://54.248.83.51', + 'stream_url': "http://54.248.83.51/media/videos", + 'stream_src_prefix': "/ebs/media/videos", + 'ffmpeg_path' : "", + 'db_engine':'postgresql_psycopg2', + 'db_name':'ldtplatform', + 'db_user': 'hp', + 'db_password': 'hyperplateau', + 'db_host': '127.0.0.1', + 'db_port': 0, + 'log_file' : env.remote_web_path['ldt'] + '/log/log.txt', + 'index_path' : '', + 'google_analytics_code' : "", + 'email_use_tls' : True, + 'email_host' : "", + 'email_host_user' : "", + 'email_host_user' : "", + 'email_port' : 0, + 'forbidden_stream_url' : "rtmp://media.iri.centrepompidou.fr/ddc_player/mp4:video/forbidden_stream.mp4?old_path=" + }, + 'hp' : { + 'db_engine':'postgresql_psycopg2', + 'db_name':'ldtplatform', + 'db_user': 'hp', + 'db_password': 'hyperplateau', + 'db_host': '127.0.0.1', + 'db_port': 0, + 'base_url' : '/hp', + 'ldt_netloc' : '54.248.83.51', + 'ldt_baseurl': '/', + 'ldt_url' : 'ldtplatform/', + }, +} -env.google_analytics_code = "" - -env.email_use_tls = True -env.email_host = "" -env.email_host_user = "" -env.email_host_user = "" -env.email_port = "" - -env.forbidden_stream_url = "rtmp://media.iri.centrepompidou.fr/ddc_player/mp4:video/forbidden_stream.mp4?old_path=" - diff -r 998a4f1efda1 -r 49efb495b46d src/hp/config.py.tmpl --- a/src/hp/config.py.tmpl Fri Nov 16 01:16:41 2012 +0100 +++ b/src/hp/config.py.tmpl Fri Nov 16 01:50:13 2012 +0100 @@ -63,10 +63,10 @@ 'disable_existing_loggers': False, 'formatters' : { 'simple' : { - 'format': "%(asctime)s - %(levelname)s : %(message)s", + 'format': "%%(asctime)s - %%(levelname)s : %%(message)s", }, 'semi-verbose': { - 'format': '%(levelname)s %(asctime)s %(module)s %(message)s' + 'format': '%%(levelname)s %%(asctime)s %%(module)s %%(message)s' }, }, 'handlers': {