mirror of
https://github.com/openshift/source-to-image.git
synced 2026-02-05 12:44:54 +01:00
Add error handling when wharfie build fails
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
pbr>=0.5.21,<1.0
|
||||
docopt>=0.6.1
|
||||
docker-py>=0.2.3
|
||||
colorama>=0.2.5
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from colorama import *
|
||||
import os
|
||||
import sys
|
||||
import docopt
|
||||
@@ -124,10 +125,15 @@ class Builder(object):
|
||||
print("Building new docker image")
|
||||
img, logs = self.docker_client.build(tag=tag, path=tmp_dir, rm=True)
|
||||
print("Build logs: %s" % logs)
|
||||
if tag:
|
||||
print("Built image %s" % tag)
|
||||
|
||||
if img is not None:
|
||||
if tag:
|
||||
print("Built image %s" % tag)
|
||||
else:
|
||||
print("Built image %s" % img)
|
||||
else:
|
||||
print("Built image %s" % img)
|
||||
print(Fore.RED + "Wharfie build failed.")
|
||||
|
||||
finally:
|
||||
shutil.rmtree(tmp_dir)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user