try to correct config template
authorymh <ymh.work@gmail.com>
Fri, 16 Nov 2012 01:50:13 +0100
changeset 54 49efb495b46d
parent 53 998a4f1efda1
child 55 9dd0a3c94448
try to correct config template
sbin/sync/config.py.tmpl
src/hp/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 = ['<user>@<server1>']
+env.hosts = ['hp@54.248.83.51']
 
-env.web_group = '<web_user_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 = "<local path used to export hg version>"
-env.export_prefix = "hyperplateau"
-env.remote_web_path = "<path of website root folder on the server>"
-env.platform_web_module = "hyperplateau"
-env.remote_virtualenv_path = "<path of the virtualenv on the server>"
-env.remote_venv_export_path = "<path for temporary export path of virtualenv resources>" 
-env.remote_baseline_venv = "<path of virtualenv baseline used for virtualenv creation>"
-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://<base_url>"
-env.stream_url = "<base_streaming_url>" #optional
-
-env.stream_src_prefix = ""
-env.ffmpeg_path = "<path_to_ffmpeg>" #optional
+env.relaunch_cmd = {'ldt':"supervisorctl restart ldtplatform", 'hp':"supervisorctl restart hp"}
 
-env.db_engine = '<database driver>' #cf django documentation
-env.db_name = '<database name>'
-env.db_user = '<database user>'
-env.db_password = ''
-env.db_host = '<database host>'
-env.db_port = <database 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="
-
--- 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': {