trigger: fix custom tags
This commit is contained in:
parent
f782764ba5
commit
d0f5808a62
1 changed files with 10 additions and 6 deletions
|
@ -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
|
||||
|
|
Reference in a new issue