Skip to content

Commit

Permalink
Fix cwd bug
Browse files Browse the repository at this point in the history
  • Loading branch information
janhybs committed Dec 16, 2018
1 parent 1a9e290 commit f4512de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
7 changes: 4 additions & 3 deletions cihpc/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,12 @@ def main(cmd_args=None):
sys.exit(1)
else:
logger.debug('determined config dir: %s' % project_dir)
config_path = os.path.join(project_dir, 'config.yaml')

global_configuration.project_cfg_dir = project_dir
global_configuration.project_cfg = config_path

# this file contains all the sections and actions for installation and testing
config_path = os.path.join(project_dir, 'config.yaml')
config_yaml = cfgutil.yaml_load(cfgutil.read_file(config_path))
project_name = config_yaml.get('project', None)

Expand Down Expand Up @@ -333,8 +336,6 @@ def main(cmd_args=None):
# variables['cpu-count'] = args.cpu_count

global_configuration.project_name = project_name
global_configuration.project_cfg_dir = project_dir
global_configuration.project_cfg = config_path

# -----------------------------------------------------------------

Expand Down
2 changes: 0 additions & 2 deletions cihpc/git_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,6 @@ def main():
' %s' % project_dir)

webhook_trigger = WebhookTrigger.from_file(os.path.join(project_dir, 'webhook.yaml'))
print(webhook_trigger.branches)
print(webhook_trigger.actions)

ws = WebhookService(
'webhook-service',
Expand Down
7 changes: 4 additions & 3 deletions cihpc/git_tools/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,16 @@ def process(self, payload):
"""
project = payload.repository.name
commit = payload.after
branch = payload.ref
branch_full = payload.ref
branch = strings.startswith_strip(branch_full, 'refs/heads/')
url = payload.repository.html_url
rest_args = [project, commit, payload.ref, branch, url]
rest_args = [project, commit, branch, url]

match = False
for b in self.branches:
b = b.replace('*', '.*')
match |= bool(re.match(b, branch))
match |= bool(re.match(b, strings.startswith_strip(branch, 'refs/heads/')))
match |= bool(re.match(b, branch_full))

if not match:
return None
Expand Down

0 comments on commit f4512de

Please sign in to comment.