From 7a4c92e7171d642a1e1fce324441710ad4d44ce9 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 19 May 2018 18:45:36 +0300 Subject: Change: use build graphs in build resources, instead of action list --- ick2/projectapi.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'ick2/projectapi.py') diff --git a/ick2/projectapi.py b/ick2/projectapi.py index 22a5bb6..ffa46bb 100644 --- a/ick2/projectapi.py +++ b/ick2/projectapi.py @@ -63,11 +63,6 @@ class ProjectAPI(ick2.ResourceApiBase): with self._trans.new('builds', build_id) as build: parameters = project.get('parameters', {}) - create_workspace = { - 'action': 'create_workspace', - 'where': 'host', - } - actions = [create_workspace] + self._get_actions(project) build.from_dict({ 'build_id': build_id, 'build_number': build_no, @@ -76,9 +71,26 @@ class ProjectAPI(ick2.ResourceApiBase): 'project': project['project'], 'parameters': parameters, 'status': 'triggered', - 'actions': actions, - 'current_action': 0, + 'graph': {}, }) + + create_workspace = { + 'action': 'create_workspace', + 'where': 'host', + } + + build_obj = ick2.Build(build) + graph = build_obj.get_graph() + graph.append_action(create_workspace) + for action in self._get_actions(project): + graph.append_action(action) + + with self._trans.new('log', build_id) as r: + r.from_dict({ + 'build_id': build_id, + 'log': '', + }) + return build_id, build_no def _pick_build_number(self, project): # pragma: no cover -- cgit v1.2.1