diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-09-01 11:56:03 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-04 00:07:29 +0100 |
commit | 9428b19a7dd1d265d9f3211004391abe33ea0224 (patch) | |
tree | 85d1b03ec2861ce567e5ca34d713edf3a2722cfb | |
parent | 25c46772a85384144e1fb1ecad3b6956c67c4e07 (diff) | |
download | poky-9428b19a7dd1d265d9f3211004391abe33ea0224.tar.gz |
toaster: fire TaskArtifacts event
Fire TaskArtifact MetaData event for deployment tasks when task
either completed or skipped. Event contains full task id
(recipe+task) and list of deployment artifacts from sstate
manifest.
This should allow Toaster to always get notified about deployment
artifacts produced by the build.
[YOCTO #9869]
(From OE-Core rev: 9b08503eabf78bc1b114416523b41dcce3449f58)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/toaster.bbclass | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass index 972efb94e4..4bddf34e9c 100644 --- a/meta/classes/toaster.bbclass +++ b/meta/classes/toaster.bbclass | |||
@@ -324,6 +324,20 @@ python toaster_buildhistory_dump() { | |||
324 | 324 | ||
325 | } | 325 | } |
326 | 326 | ||
327 | # get list of artifacts from sstate manifest | ||
328 | python toaster_artifacts() { | ||
329 | if e.taskname in ["do_deploy", "do_image_complete", "do_populate_sdk", "do_populate_sdk_ext"]: | ||
330 | d2 = d.createCopy() | ||
331 | d2.setVar('FILE', e.taskfile) | ||
332 | d2.setVar('SSTATE_MANMACH', d2.expand("${MACHINE}")) | ||
333 | manifest = oe.sstatesig.sstate_get_manifest_filename(e.taskname[3:], d2)[0] | ||
334 | if os.access(manifest, os.R_OK): | ||
335 | with open(manifest) as fmanifest: | ||
336 | artifacts = [fname.strip() for fname in fmanifest] | ||
337 | data = {"task": e.taskid, "artifacts": artifacts} | ||
338 | bb.event.fire(bb.event.MetadataEvent("TaskArtifacts", data), d2) | ||
339 | } | ||
340 | |||
327 | # set event handlers | 341 | # set event handlers |
328 | addhandler toaster_layerinfo_dumpdata | 342 | addhandler toaster_layerinfo_dumpdata |
329 | toaster_layerinfo_dumpdata[eventmask] = "bb.event.TreeDataPreparationCompleted" | 343 | toaster_layerinfo_dumpdata[eventmask] = "bb.event.TreeDataPreparationCompleted" |
@@ -334,6 +348,9 @@ toaster_collect_task_stats[eventmask] = "bb.event.BuildCompleted bb.build.TaskSu | |||
334 | addhandler toaster_buildhistory_dump | 348 | addhandler toaster_buildhistory_dump |
335 | toaster_buildhistory_dump[eventmask] = "bb.event.BuildCompleted" | 349 | toaster_buildhistory_dump[eventmask] = "bb.event.BuildCompleted" |
336 | 350 | ||
351 | addhandler toaster_artifacts | ||
352 | toaster_artifacts[eventmask] = "bb.runqueue.runQueueTaskSkipped bb.runqueue.runQueueTaskCompleted" | ||
353 | |||
337 | do_packagedata_setscene[postfuncs] += "toaster_package_dumpdata " | 354 | do_packagedata_setscene[postfuncs] += "toaster_package_dumpdata " |
338 | do_packagedata_setscene[vardepsexclude] += "toaster_package_dumpdata " | 355 | do_packagedata_setscene[vardepsexclude] += "toaster_package_dumpdata " |
339 | 356 | ||