Commit 618ab0b61ad34f3ad57fa4758964af4915bd2cbd

Authored by Sergio Oliveira
2 parents 165c3e80 ee6a8816

Merge branch 'master' into notrac

Showing 2 changed files with 9 additions and 4 deletions   Show diff stats
@@ -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:
@@ -155,9 +158,10 @@ def update_code(): @@ -155,9 +158,10 @@ def update_code():
155 return 158 return
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 {} {} -b {}'.format(REPO_URL, REPO_PATH, REPO_BRANCH))
159 else: 162 else:
160 with cd(REPO_PATH): 163 with cd(REPO_PATH):
  164 + run('git checkout {}'.format(REPO_BRANCH))
161 run('git pull') 165 run('git pull')
162 166
163 167
puppet/bootstrap.py
@@ -17,6 +17,7 @@ except ImportError: @@ -17,6 +17,7 @@ except ImportError:
17 17
18 PUPPET_TARGET_VERSION = "3.6.2" 18 PUPPET_TARGET_VERSION = "3.6.2"
19 PUPPET_DIR = os.path.join(os.path.dirname(__file__)) 19 PUPPET_DIR = os.path.join(os.path.dirname(__file__))
  20 +HIERA_FILE = os.path.join(PUPPET_DIR, 'hiera.yaml')
20 MODULES_FILE_PATH = os.path.join(PUPPET_DIR, 'modules.txt') 21 MODULES_FILE_PATH = os.path.join(PUPPET_DIR, 'modules.txt')
21 22
22 DIST_CMD = { 23 DIST_CMD = {
@@ -188,8 +189,8 @@ def main(): @@ -188,8 +189,8 @@ def main():
188 print('Failed installing puppet') 189 print('Failed installing puppet')
189 exit(result) 190 exit(result)
190 191
191 - if os.path.isfile('/vagrant/puppet/hiera.yaml'):  
192 - copyfile('/vagrant/puppet/hiera.yaml', '/etc/puppet/hiera.yaml') 192 + if os.path.isfile(HIERA_FILE):
  193 + copyfile(HIERA_FILE, '/etc/puppet/hiera.yaml')
193 194
194 install_puppet_modules() 195 install_puppet_modules()
195 196