Commit f7a07387a8b93e670d35e898e3886a3cf8e60f49

Authored by Sergio Oliveira
1 parent e729dd17

Using git branch for deploy

Conflicts:
	fabfile.py
Showing 1 changed file with 6 additions and 1 deletions   Show diff stats
fabfile.py
... ... @@ -24,7 +24,8 @@ DISTRO_CMD = {
24 24 }
25 25  
26 26 APP_USER = APP_NAME = VENV_NAME = 'colab'
27   -REPO_URL = 'git@github.com:colab-community/colab.git'
  27 +REPO_URL = 'https://github.com/colab-community/colab.git'
  28 +REPO_BRANCH = 'master'
28 29  
29 30  
30 31 environments = {
... ... @@ -71,6 +72,7 @@ def cmd(family, command, args=''):
71 72 def environment(name=DEFAULT_ENVIRONMENT):
72 73 """Set the environment where the tasks will be executed"""
73 74 global REPO_URL
  75 + global REPO_BRANCH
74 76  
75 77 try:
76 78 import project_cfg
... ... @@ -78,6 +80,7 @@ def environment(name=DEFAULT_ENVIRONMENT):
78 80 pass
79 81 else:
80 82 REPO_URL = project_cfg.repository_url
  83 + REPO_BRANCH = project_cfg.branch
81 84 environments.update(project_cfg.environments)
82 85  
83 86 if name not in environments:
... ... @@ -156,8 +159,10 @@ def update_code():
156 159  
157 160 if not exists(REPO_PATH):
158 161 run('git clone {} {}'.format(REPO_URL, REPO_PATH))
  162 + run('git checkout {}'.format(REPO_BRANCH))
159 163 else:
160 164 with cd(REPO_PATH):
  165 + run('git checkout {}'.format(REPO_BRANCH))
161 166 run('git pull')
162 167  
163 168  
... ...