Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fabfile/common.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/fabfile/common.py b/fabfile/common.py
index 8e5d801..752886b 100644
--- a/fabfile/common.py
+++ b/fabfile/common.py
@@ -66,10 +66,11 @@ def get_instance_name():
global _instance_name
if _instance_name is None:
+ _instance_name == "production"
+
branch = local("git rev-parse --abbrev-ref HEAD", capture=True)
- if branch == "master":
- _instance_name = "production"
- else:
- _instance_name = "testing"
+ for name, info in instances.items():
+ if info["branch"] == branch:
+ _instance_name = name
return _instance_name