summaryrefslogtreecommitdiffstats
path: root/GitAutoDeploy.py
diff options
context:
space:
mode:
Diffstat (limited to 'GitAutoDeploy.py')
-rwxr-xr-xGitAutoDeploy.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/GitAutoDeploy.py b/GitAutoDeploy.py
index 32bc525..7a809a4 100755
--- a/GitAutoDeploy.py
+++ b/GitAutoDeploy.py
@@ -80,10 +80,13 @@ class GitWrapper():
return int(res)
@staticmethod
- def clone(url, path):
+ def clone(url, branch, path):
from subprocess import call
- call(['git clone --recursive %s %s' % (url, path)], shell=True)
+ if branch:
+ call(['git clone --recursive %s -b %s %s' % (url, branch, path)], shell=True)
+ else:
+ call(['git clone --recursive %s %s' % (url, path)], shell=True)
@staticmethod
@@ -435,7 +438,7 @@ class GitAutoDeploy(object):
if not os.path.isdir(repo_config['path']):
print "Directory %s not found" % repo_config['path']
- GitWrapper.clone(url=repo_config['url'], path=repo_config['path'])
+ GitWrapper.clone(url=repo_config['url'], branch=repo_config['branch'], path=repo_config['path'])
if not os.path.isdir(repo_config['path']):
print "Unable to clone repository %s" % repo_config['url']