Merge "Do not push image if build failed"

This commit is contained in:
Jenkins 2016-08-19 12:13:18 +00:00 committed by Gerrit Code Review
commit 900a61c184
1 changed files with 5 additions and 0 deletions

View File

@ -145,6 +145,11 @@ def build_dockerfile(dc, dockerfile):
def push_dockerfile(dc, dockerfile):
if dockerfile['build_result'] == 'Failure':
dockerfile['push_result'] = 'Failure'
LOG.error("%s: Push will be skipped due to build failure",
dockerfile['name'])
return
if CONF.registry.username and CONF.registry.password:
dc.login(username=CONF.registry.username,
password=CONF.registry.password,