From 98b213fca8cc23f63e427c900c11cfad6ae4ceba Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 7 May 2020 10:58:40 +0300 Subject: Change: sync workspace after a build, even if build failed --- contractor | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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): -- cgit v1.2.1