config.json/utils: Allow buildhistory to be configurable and disable for oe-selftest in qemu-arch

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2019-04-12 16:23:54 +01:00
parent 59f5a5723d
commit f9bdcf888f
4 changed files with 9 additions and 6 deletions

View File

@ -3,7 +3,6 @@
"BASE_SHAREDDIR" : "/srv/autobuilder/autobuilder.yoctoproject.org",
"BASE_PUBLISHDIR" : "/srv/autobuilder/downloads.yoctoproject.org",
"build-history-targets" : ["qemuarm64", "qemuarm", "qemuarm-lsb", "qemumips64", "qemumips", "qemumips-lsb", "qemuppc", "qemuppc-lsb", "qemux86-64", "qemux86-64-lsb", "qemux86", "qemux86-lsb"],
"BUILD_HISTORY_DIR" : "buildhistory",
"BUILD_HISTORY_REPO" : "ssh://git@push.yoctoproject.org/poky-buildhistory",
"BUILD_HISTORY_DIRECTPUSH" : ["poky:morty", "poky:pyro", "poky:rocko", "poky:sumo", "poky:thud", "poky:warrior", "poky:master"],
@ -31,6 +30,7 @@
"SSTATEDIR_RELEASE" : ["SSTATE_MIRRORS += 'file://.* file://${BASE_SHAREDDIR}/pub/sstate/PATH'", "SSTATE_DIR ?= '${BASE_PUBLISHDIR}/sstate/@RELEASENUM@'"],
"SDKEXTRAS" : ["SSTATE_MIRRORS += '\\", "file://.* http://sstate.yoctoproject.org/dev/@RELEASENUM@PATH;downloadfilename=PATH'"],
"BUILDINFO" : false,
"BUILDHISTORY" : false,
"BUILDINFOVARS" : ["INHERIT += 'image-buildinfo'", "IMAGE_BUILDINFO_VARS_append = ' IMAGE_BASENAME IMAGE_NAME'"],
"WRITECONFIG" : true,
"SENDERRORS" : true,
@ -56,6 +56,7 @@
"templates" : {
"arch-qemu" : {
"BUILDINFO" : true,
"BUILDHISTORY" : true,
"step1" : {
"BBTARGETS" : "core-image-sato core-image-sato-dev core-image-sato-sdk core-image-minimal core-image-minimal-dev core-image-sato:do_populate_sdk",
"SANITYTARGETS" : "core-image-minimal:do_testimage core-image-sato:do_testimage core-image-sato-sdk:do_testimage core-image-sato:do_testsdk"
@ -67,6 +68,7 @@
},
"step3" : {
"PRSERV" : false,
"BUILDHISTORY" : false,
"EXTRACMDS" : ["${SCRIPTSDIR}/checkvnc; DISPLAY=:1 oe-selftest -r runqemu meta_ide -j 15"],
"ADDLAYER" : ["${BUILDDIR}/../meta-selftest"]
}
@ -74,6 +76,7 @@
"lsb-qemu" : {
"DISTRO" : "poky-lsb",
"BUILDINFO" : true,
"BUILDHISTORY" : true,
"step1" : {
"BBTARGETS" : "core-image-lsb core-image-lsb-dev core-image-lsb-sdk",
"SANITYTARGETS" : "core-image-lsb:do_testimage core-image-lsb-sdk:do_testimage"

View File

@ -143,7 +143,7 @@ def runcmd(cmd, *args, **kwargs):
except subprocess.CalledProcessError:
print("ERROR: Command %s failed" % cmd)
bh_path, remoterepo, remotebranch, baseremotebranch = utils.getbuildhistoryconfig(ourconfig, args.builddir, args.target, args.reponame, args.branchname)
bh_path, remoterepo, remotebranch, baseremotebranch = utils.getbuildhistoryconfig(ourconfig, args.builddir, args.target, args.reponame, args.branchname, stepnum)
if bh_path:
runcmd([os.path.join(scriptsdir, "buildhistory-init"), bh_path, remoterepo, remotebranch, baseremotebranch])

View File

@ -92,7 +92,7 @@ extravars = utils.getconfiglistfilter("extravars", ourconfig, args.target, stepn
if extravars:
variables.extend(extravars)
bh_path, remoterepo, remotebranch, baseremotebranch = utils.getbuildhistoryconfig(ourconfig, args.builddir, args.target, args.reponame, args.branchname)
bh_path, remoterepo, remotebranch, baseremotebranch = utils.getbuildhistoryconfig(ourconfig, args.builddir, args.target, args.reponame, args.branchname, stepnum)
if bh_path:
variables.append('INHERIT += "buildhistory"')
variables.append('BUILDHISTORY_DIR = "%s"' % bh_path)

View File

@ -194,9 +194,9 @@ def loadconfig():
#
# Common function to determine if buildhistory is enabled and what the parameters are
#
def getbuildhistoryconfig(ourconfig, builddir, target, reponame, branchname):
if contains(["BUILD_HISTORY_DIR", "build-history-targets", "BUILD_HISTORY_REPO"], ourconfig):
if target in getconfig("build-history-targets", ourconfig):
def getbuildhistoryconfig(ourconfig, builddir, target, reponame, branchname, stepnum):
if contains(["BUILD_HISTORY_DIR", "BUILD_HISTORY_REPO"], ourconfig):
if utils.getconfigvar("BUILDHISTORY", ourconfig, target, stepnum):
base = None
if "/" in reponame:
reponame = reponame.rsplit("/", 1)[1]