summaryrefslogtreecommitdiff
path: root/ick2/projectapi.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-05-19 18:45:36 +0300
committerLars Wirzenius <liw@liw.fi>2018-05-19 22:58:43 +0300
commit7a4c92e7171d642a1e1fce324441710ad4d44ce9 (patch)
tree290526533839801bf060df347f8ee32232f3e1e5 /ick2/projectapi.py
parentb11d31ef23c5dfee6bfa54afbec47fc8b8bab7b1 (diff)
downloadick2-7a4c92e7171d642a1e1fce324441710ad4d44ce9.tar.gz
Change: use build graphs in build resources, instead of action list
Diffstat (limited to 'ick2/projectapi.py')
-rw-r--r--ick2/projectapi.py26
1 files changed, 19 insertions, 7 deletions
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