Commit f7a07387a8b93e670d35e898e3886a3cf8e60f49
1 parent
e729dd17
Exists in
master
and in
39 other branches
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,7 +24,8 @@ DISTRO_CMD = { | ||
24 | } | 24 | } |
25 | 25 | ||
26 | APP_USER = APP_NAME = VENV_NAME = 'colab' | 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 | environments = { | 31 | environments = { |
@@ -71,6 +72,7 @@ def cmd(family, command, args=''): | @@ -71,6 +72,7 @@ def cmd(family, command, args=''): | ||
71 | def environment(name=DEFAULT_ENVIRONMENT): | 72 | def environment(name=DEFAULT_ENVIRONMENT): |
72 | """Set the environment where the tasks will be executed""" | 73 | """Set the environment where the tasks will be executed""" |
73 | global REPO_URL | 74 | global REPO_URL |
75 | + global REPO_BRANCH | ||
74 | 76 | ||
75 | try: | 77 | try: |
76 | import project_cfg | 78 | import project_cfg |
@@ -78,6 +80,7 @@ def environment(name=DEFAULT_ENVIRONMENT): | @@ -78,6 +80,7 @@ def environment(name=DEFAULT_ENVIRONMENT): | ||
78 | pass | 80 | pass |
79 | else: | 81 | else: |
80 | REPO_URL = project_cfg.repository_url | 82 | REPO_URL = project_cfg.repository_url |
83 | + REPO_BRANCH = project_cfg.branch | ||
81 | environments.update(project_cfg.environments) | 84 | environments.update(project_cfg.environments) |
82 | 85 | ||
83 | if name not in environments: | 86 | if name not in environments: |
@@ -156,8 +159,10 @@ def update_code(): | @@ -156,8 +159,10 @@ def update_code(): | ||
156 | 159 | ||
157 | if not exists(REPO_PATH): | 160 | if not exists(REPO_PATH): |
158 | run('git clone {} {}'.format(REPO_URL, REPO_PATH)) | 161 | run('git clone {} {}'.format(REPO_URL, REPO_PATH)) |
162 | + run('git checkout {}'.format(REPO_BRANCH)) | ||
159 | else: | 163 | else: |
160 | with cd(REPO_PATH): | 164 | with cd(REPO_PATH): |
165 | + run('git checkout {}'.format(REPO_BRANCH)) | ||
161 | run('git pull') | 166 | run('git pull') |
162 | 167 | ||
163 | 168 |