Cluster script, handle branches better but default to master

This commit is contained in:
Tim Kuhlman 2014-06-27 14:10:54 -06:00
parent 4f3550f54b
commit c2e908a25a
2 changed files with 5 additions and 1 deletions

View File

@ -67,6 +67,10 @@ def git_mini_mon(install_dir, branch=None, proxy=None):
if branch is not None:
with cd(install_dir):
with settings(hide('everything'), warn_only=True):
branch_exists = sudo('git branch| grep %s' % branch)
if branch_exists.failed:
sudo('git branch {branch} origin/{branch}'.format(branch=branch))
sudo('git checkout %s' % branch)
@task(default=True)

View File

@ -41,7 +41,7 @@ class SetupCluster(Task):
The data bags in the cluster subdir should be properly setup for the environment before running.
"""
execute(install_deps)
execute(git_mini_mon, self.mini_mon_dir, 'feature/cluster')
execute(git_mini_mon, self.mini_mon_dir)
# download cookbooks
with settings(hide('running', 'output', 'warnings'), warn_only=True):