trigger: fix custom tags

This commit is contained in:
Jimmy Zelinskie 2015-04-03 17:14:03 -04:00
parent f782764ba5
commit d0f5808a62

View file

@ -629,18 +629,22 @@ class CustomBuildTrigger(BuildTrigger):
return config
def manual_start(self, trigger, run_parameters=None):
for parameter in ['branch_name', 'commit_sha',]:
for parameter in ['commit_sha']:
if parameter not in run_parameters:
raise TriggerStartException
raise TriggerStartException('missing required parameter')
config = get_trigger_config(trigger)
dockerfile_id = None
branch = run_parameters.get('branch_name', None)
tags = {branch} if branch is not None else {}
tags = {branch}
if branch == 'master':
tags.add('latest')
build_name = 'HEAD'
metadata = {
'commit_sha': run_parameters['commit_sha'],
'default_branch': branch,
'ref': 'refs/heads/%s' % branch,
'git_url': config['build_source'],
}
return dockerfile_id, tags, build_name, trigger.config['subdir'], metadata
return dockerfile_id, list(tags), build_name, config['subdir'], metadata