Commits

Benoit C committed 778543d

conf is now a parameter of the prod/preprod task

Comments (0)

Files changed (1)

     fab {pre,}prod install
 
 
-    note:
-        - pour gérer la DB, je ne fais que droper la DB (en preprod)
-    et resync la db.
-
-
     todo: 
         - ajouter south
 """
 import time
 
 
-def load_yaml(env_type):
+def load_yaml(env_type, conf):
     # sure we can do more there
-    env.yaml = yaml.load(file("conf.yaml").read()).get(env_type)
+    env.yaml = yaml.load(file(conf).read()).get(env_type)
 
-def preprod():
-    load_yaml('preprod')
+def preprod(conf="conf.yaml"):
+    load_yaml('preprod', conf)
     env.project_name = env.yaml.get('project').get('name')
     env.type = 'preprod'
     env.hosts = env.yaml.get('hosts').get('web')
     env.path = env.yaml.get('project').get('root_dir')
     env.virtualhost_path = env.path
 
-def prod():
+def prod(conf="conf.yaml"):
     print "updating for %s => preprod" % env.project_name
-    load_yaml('prod')
+    load_yaml('prod', conf)
     env.type = 'prod'
 
     env.hosts = env.yaml.get('hosts').get('web')
 @Permissions("sudo_user", env)
 @ConfChecker("httpd", env)
 def install_httpd_vhost():
-    print "installing nginx vhost for %s" % env.project_name
     with cd(env.path):
         conf = env.yaml.get("httpd")
         fname = "%s/deploy/vhost-%s-%s" % (env.path, env.type, env.project_name)