summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldcontrol/sshbecontroller.py
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-06-02 12:57:03 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-26 09:27:31 +0100
commit0b2e6442a6da8d05649530365601f49d37cb6ab5 (patch)
treea05a29556ae671ee0dd68b77cc952a2370f1dde9 /bitbake/lib/toaster/bldcontrol/sshbecontroller.py
parentaad93dd3b78781e0a170345a5cf5ad59557e4170 (diff)
downloadpoky-0b2e6442a6da8d05649530365601f49d37cb6ab5.tar.gz
bitbake: toaster: improve the buildenvironment API
We improve the buildenvironment API by reducing it to a single command: triggerBuild. This command is specifically implemented in each BE controller type, so the runbuilds management command is only concerned with scheduling the next build, and not with the details of how a build is actually started. (Bitbake rev: 7ee0f1da0a8fcac37419ffdddbe35a9268a1ded4) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/sshbecontroller.py')
-rw-r--r--bitbake/lib/toaster/bldcontrol/sshbecontroller.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/sshbecontroller.py b/bitbake/lib/toaster/bldcontrol/sshbecontroller.py
index 29ed0a770f..8ef434baf5 100644
--- a/bitbake/lib/toaster/bldcontrol/sshbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/sshbecontroller.py
@@ -156,3 +156,24 @@ class SSHBEController(BuildEnvironmentController):
156 import shutil 156 import shutil
157 shutil.rmtree(os.path.join(self.be.sourcedir, "build")) 157 shutil.rmtree(os.path.join(self.be.sourcedir, "build"))
158 assert not self._pathexists(self.be.builddir) 158 assert not self._pathexists(self.be.builddir)
159
160 def triggerBuild(self, bitbake, layers, variables, targets):
161 # set up the buid environment with the needed layers
162 self.setLayers(bitbake, layers)
163 self.writeConfFile("conf/toaster-pre.conf", )
164 self.writeConfFile("conf/toaster.conf", raw = "INHERIT+=\"toaster buildhistory\"")
165
166 # get the bb server running with the build req id and build env id
167 bbctrl = self.getBBController()
168
169 # trigger the build command
170 task = reduce(lambda x, y: x if len(y)== 0 else y, map(lambda y: y.task, targets))
171 if len(task) == 0:
172 task = None
173
174 bbctrl.build(list(map(lambda x:x.target, targets)), task)
175
176 logger.debug("localhostbecontroller: Build launched, exiting. Follow build logs at %s/toaster_ui.log" % self.be.builddir)
177
178 # disconnect from the server
179 bbctrl.disconnect()