diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2015-06-02 12:57:03 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-06-26 09:27:31 +0100 |
commit | 0b2e6442a6da8d05649530365601f49d37cb6ab5 (patch) | |
tree | a05a29556ae671ee0dd68b77cc952a2370f1dde9 /bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | |
parent | aad93dd3b78781e0a170345a5cf5ad59557e4170 (diff) | |
download | poky-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/localhostbecontroller.py')
-rw-r--r-- | bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py index bc3566acee..d0f86325e9 100644 --- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py +++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | |||
@@ -317,3 +317,25 @@ class LocalhostBEController(BuildEnvironmentController): | |||
317 | import shutil | 317 | import shutil |
318 | shutil.rmtree(os.path.join(self.be.sourcedir, "build")) | 318 | shutil.rmtree(os.path.join(self.be.sourcedir, "build")) |
319 | assert not os.path.exists(self.be.builddir) | 319 | assert not os.path.exists(self.be.builddir) |
320 | |||
321 | |||
322 | def triggerBuild(self, bitbake, layers, variables, targets): | ||
323 | # set up the buid environment with the needed layers | ||
324 | self.setLayers(bitbake, layers) | ||
325 | self.writeConfFile("conf/toaster-pre.conf", ) | ||
326 | self.writeConfFile("conf/toaster.conf", raw = "INHERIT+=\"toaster buildhistory\"") | ||
327 | |||
328 | # get the bb server running with the build req id and build env id | ||
329 | bbctrl = self.getBBController() | ||
330 | |||
331 | # trigger the build command | ||
332 | task = reduce(lambda x, y: x if len(y)== 0 else y, map(lambda y: y.task, targets)) | ||
333 | if len(task) == 0: | ||
334 | task = None | ||
335 | |||
336 | bbctrl.build(list(map(lambda x:x.target, targets)), task) | ||
337 | |||
338 | logger.debug("localhostbecontroller: Build launched, exiting. Follow build logs at %s/toaster_ui.log" % self.be.builddir) | ||
339 | |||
340 | # disconnect from the server | ||
341 | bbctrl.disconnect() | ||