diff options
author | Jürg Billeter <j@bitron.ch> | 2018-10-05 09:50:21 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2018-11-27 13:41:09 +0000 |
commit | 04f05b1a77750eae8690b3499839d9c600f2a60c (patch) | |
tree | 396a68ef4589ae0d465e5c4af3db0554428eb7ee | |
parent | bb7c3213ee42209d3dcb4f9ad369900a042b638a (diff) | |
download | buildstream-04f05b1a77750eae8690b3499839d9c600f2a60c.tar.gz |
element.py: Support command batching for integration commands
-rw-r--r-- | buildstream/element.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/buildstream/element.py b/buildstream/element.py index 582492d6b..ac95ee467 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -770,14 +770,13 @@ class Element(Plugin): environment = self.get_environment() if bstdata is not None: - commands = self.node_get_member(bstdata, list, 'integration-commands', []) - for i in range(len(commands)): - cmd = self.node_subst_list_element(bstdata, 'integration-commands', [i]) - self.status("Running integration command", detail=cmd) - exitcode = sandbox.run(['sh', '-e', '-c', cmd], SandboxFlags.NONE, - env=environment, cwd='/') - if exitcode != 0: - raise ElementError("Command '{}' failed with exitcode {}".format(cmd, exitcode)) + with sandbox.batch(SandboxFlags.NONE): + commands = self.node_get_member(bstdata, list, 'integration-commands', []) + for i in range(len(commands)): + cmd = self.node_subst_list_element(bstdata, 'integration-commands', [i]) + + sandbox.run(['sh', '-e', '-c', cmd], 0, env=environment, cwd='/', + label=cmd) def stage_sources(self, sandbox, directory): """Stage this element's sources to a directory in the sandbox |