summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-05-07 07:59:22 +0000
committerLars Wirzenius <liw@liw.fi>2020-05-07 07:59:22 +0000
commit4d7096b19b05bd2b26debb52ba88c70cca684308 (patch)
treeea382b9996290476fa542f2d4c19adef45ffa322
parentb2deb18a85a268966b4c5d6215c1b5e95cf22fd1 (diff)
parent98b213fca8cc23f63e427c900c11cfad6ae4ceba (diff)
downloadick-contractor-4d7096b19b05bd2b26debb52ba88c70cca684308.tar.gz
Merge branch 'failsave' into 'master'
Change: sync workspace after a build, even if build failed See merge request larswirzenius/contractor!9
-rwxr-xr-xcontractor6
1 files changed, 5 insertions, 1 deletions
diff --git a/contractor b/contractor
index a879417..0fdff50 100755
--- a/contractor
+++ b/contractor
@@ -128,7 +128,7 @@ class ContractorApplication(cliapp.Application):
Chdir('/workspace/src'),
Build(bs.build()),
]
- self.exec_verbosely(worker, *execs)
+ build_failed = worker.verbosely(*execs).failed()
with Timer(self.verbose, 'shutdown-worker'):
execs = [
@@ -142,6 +142,10 @@ class ContractorApplication(cliapp.Application):
self.verbose('saving workspace to {}'.format(ws))
self.sync_from_workspace(dest, port, ws)
+ if build_failed:
+ self.error('build FAILED')
+ sys.exit(1)
+
self.verbose('build finished OK')
def load_build_spec(self, filename):