diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2013-01-30 12:50:54 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2013-01-30 12:50:54 (GMT) |
commit | cf9983af225eb179d1370a4210bbed905fae4663 (patch) | |
tree | 35c037e289681950068e8660865f559104e5e665 | |
parent | 88f63f61843ae0938faa8078ebfa47f6ffe86f6f (diff) |
Smarter instance guessingtesting
-rw-r--r-- | fabfile/common.py | 9 |
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 |