From 625d8e3b16ccea2eb84de83fd829be180986c829 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 13 Nov 2017 19:59:21 +0100 Subject: Add: if a build step fails, terminate build --- ick2/controllerapi.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'ick2/controllerapi.py') 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'] -- cgit v1.2.1