Benoit C avatar 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.
         - 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)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.