builders: Clean up buildirectories of successful builds

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2020-11-11 18:05:32 +00:00
parent 25d5a7d0ae
commit 3a9b218c83

View File

@ -3,6 +3,7 @@ from buildbot.plugins import *
from yoctoabb import config from yoctoabb import config
from yoctoabb.steps.writelayerinfo import WriteLayerInfo from yoctoabb.steps.writelayerinfo import WriteLayerInfo
from yoctoabb.steps.runconfig import get_publish_dest, get_publish_resultdir, get_publish_name, RunConfigCheckSteps from yoctoabb.steps.runconfig import get_publish_dest, get_publish_resultdir, get_publish_name, RunConfigCheckSteps
from buildbot.process.results import Results, SUCCESS, FAILURE, CANCELLED, WARNINGS, SKIPPED, EXCEPTION, RETRY
from yoctoabb.steps.observer import RunConfigLogObserver from yoctoabb.steps.observer import RunConfigLogObserver
from twisted.python import log from twisted.python import log
@ -79,6 +80,13 @@ def create_builder_factory():
f.addStep(RunConfigCheckSteps(posttrigger=False)) f.addStep(RunConfigCheckSteps(posttrigger=False))
# If the build was successful, clean up the build directory
f.addStep(steps.ShellCommand(
command=[clob, util.Interpolate("%(prop:builddir)s/")],
doStepIf=lambda step: step.build.results == SUCCESS,
haltOnFailure=False,
name="Clobber build dir"))
return f return f
def nextWorker(bldr, workers, buildrequest): def nextWorker(bldr, workers, buildrequest):