summaryrefslogtreecommitdiff
path: root/ick2/controllerapi.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-11-13 19:59:21 +0100
committerLars Wirzenius <liw@liw.fi>2017-11-13 19:59:21 +0100
commit625d8e3b16ccea2eb84de83fd829be180986c829 (patch)
treec0547cf125b4ae2cf3ffecece9ed8bc1c122e308 /ick2/controllerapi.py
parent23b7b2f901e4291ae4009f845a12b1ae32b66bb3 (diff)
downloadick2-625d8e3b16ccea2eb84de83fd829be180986c829.tar.gz
Add: if a build step fails, terminate build
Diffstat (limited to 'ick2/controllerapi.py')
-rw-r--r--ick2/controllerapi.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/ick2/controllerapi.py b/ick2/controllerapi.py
index 8b4bc29..a9a97e9 100644
--- a/ick2/controllerapi.py
+++ b/ick2/controllerapi.py
@@ -435,8 +435,8 @@ class WorkAPI(APIbase):
pipeline=pipeline,
doing=doing)
- if update.get('exit_code') == 0:
- ick2.log.log('trace', msg_texg='xxx finishing step')
+ exit_code = update.get('exit_code')
+ if exit_code == 0:
index = doing['step_index'] + 1
actions = pipeline['actions']
if index >= len(actions):
@@ -453,6 +453,18 @@ class WorkAPI(APIbase):
'doing': doing,
}
self._update_worker(worker_state)
+ elif exit_code is not None:
+ assert isinstance(exit_code, int)
+ assert exit_code != 0
+ pipeline['status'] = 'idle'
+ self._finish_build(update)
+ self._update_project(project)
+
+ worker_state = {
+ 'worker': update['worker'],
+ 'doing': {},
+ }
+ self._update_worker(worker_state)
def _check_work_update(self, doing, update): # pragma: no cover
must_match = ['worker', 'project', 'pipeline', 'build_id']