mirror of
git://git.yoctoproject.org/yocto-autobuilder-helper.git
synced 2025-07-19 20:59:02 +02:00
Continue to fill out buildhistory code
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
70db7ea161
commit
d19e7f2802
|
@ -1,3 +1,5 @@
|
|||
{
|
||||
"buildhistory" : "True"
|
||||
"build-history-targets" : ["arm64", "arm", "arm-lsb", "mips64", "mips", "mips-lsb", "ppc", "ppc-lsb", "x86-64", "x86-64-lsb", "x86", "x86-lsb"],
|
||||
"BUILD_HISTORY_DIR" : "/srv/www/vhosts/autobuilder.yoctoproject.org/buildhistory",
|
||||
"BUILD_HISTORY_REPO" : "ssh://git@push.yoctoproject.org/poky-buildhistory"
|
||||
}
|
|
@ -1,27 +1,39 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Called with $1 - The target name
|
||||
# $2 - The buildhistory directory
|
||||
# $3 - The remote repository url
|
||||
# $4 - The remote branch name
|
||||
#
|
||||
TARGETNAME=$1
|
||||
BUILDHISTDIR=$2
|
||||
REMOTEREPO=$3
|
||||
REMOTEBRANCH=$4
|
||||
|
||||
echo BH $@
|
||||
|
||||
exit 0
|
||||
|
||||
# Example code dumped from an existing nightly-arm buildhistory step for reference
|
||||
|
||||
if [ ! -d /srv/www/vhosts/autobuilder.yoctoproject.org/buildhistory/poky/master-next/nightly-arm ]; then
|
||||
mkdir -p /srv/www/vhosts/autobuilder.yoctoproject.org/buildhistory/poky/master-next/nightly-arm
|
||||
git init /srv/www/vhosts/autobuilder.yoctoproject.org/buildhistory/poky/master-next/nightly-arm
|
||||
if [ ! -d $BUILDHISTDIR ]; then
|
||||
mkdir -p $BUILDHISTDIR
|
||||
git init $BUILDHISTDIR
|
||||
fi
|
||||
|
||||
rm -rf /srv/www/vhosts/autobuilder.yoctoproject.org/buildhistory/poky/master-next/nightly-arm
|
||||
mkdir -p /srv/www/vhosts/autobuilder.yoctoproject.org/buildhistory/poky/master-next/nightly-arm
|
||||
git init /srv/www/vhosts/autobuilder.yoctoproject.org/buildhistory/poky/master-next/nightly-arm
|
||||
rm -rf $BUILDHISTDIR
|
||||
mkdir -p $BUILDHISTDIR
|
||||
git init $BUILDHISTDIR
|
||||
|
||||
if git ls-remote --exit-code ssh://git@push.yoctoproject.org/poky-buildhistory refs/heads/poky/master-next/nightly-arm> /dev/null; then
|
||||
git push -q ssh://git@push.yoctoproject.org/poky-buildhistory :poky/master-next/nightly-arm
|
||||
if git ls-remote --exit-code $REMOTEREPO refs/heads/$REMOTEBRANCH> /dev/null; then
|
||||
git push -q $REMOTEREPO :$REMOTEBRANCH
|
||||
fi
|
||||
|
||||
if ! git ls-remote --exit-code ssh://git@push.yoctoproject.org/poky-buildhistory refs/heads/poky/master-next/nightly-arm > /dev/null; then
|
||||
cd /srv/www/vhosts/autobuilder.yoctoproject.org/buildhistory/poky/master-next/nightly-arm
|
||||
if ! git ls-remote --exit-code $REMOTEREPO refs/heads/$REMOTEBRANCH > /dev/null; then
|
||||
cd $BUILDHISTDIR
|
||||
echo 'Initializing Repo' >> README
|
||||
git checkout -b poky/master-next/nightly-arm
|
||||
git checkout -b $REMOTEBRANCH
|
||||
git add README
|
||||
git commit -s -m 'Initializing Repo'
|
||||
git push -q ssh://git@push.yoctoproject.org/poky-buildhistory poky/master-next/nightly-arm:poky/master-next/nightly-arm
|
||||
git push -q $REMOTEREPO $REMOTEBRANCH:$REMOTEBRANCH
|
||||
fi
|
||||
|
|
|
@ -3,13 +3,37 @@
|
|||
import json
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
scriptsdir = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
with open(os.path.join(scriptsdir, '..', 'config.json')) as f:
|
||||
ourconfig = json.load(f)
|
||||
|
||||
os.system(os.path.join(scriptsdir, "buildhistory-init"))
|
||||
target = "nightly-arm"
|
||||
branchname = "master"
|
||||
distro = "poky"
|
||||
|
||||
# Strip off "nightly-"
|
||||
target = target[8:]
|
||||
|
||||
#
|
||||
# Check if config contains all the listed params
|
||||
#
|
||||
def contains(params, config):
|
||||
for p in params:
|
||||
if p not in config:
|
||||
return False
|
||||
return True
|
||||
|
||||
if contains(["BUILD_HISTORY_DIR", "build-history-targets", "BUILD_HISTORY_REPO"], ourconfig):
|
||||
if target in ourconfig["build-history-targets"]:
|
||||
bh_path = os.path.join(ourconfig["BUILD_HISTORY_DIR"], distro, branchname, "nightly-" + target)
|
||||
remoterepo = ourconfig["BUILD_HISTORY_REPO"]
|
||||
remotebranch = distro + "/" + branchname + "/nightly-" + target
|
||||
subprocess.check_output([os.path.join(scriptsdir, "buildhistory-init"), target, bh_path, remoterepo, remotebranch], stderr=subprocess.STDOUT)
|
||||
|
||||
print(str(ourconfig))
|
||||
|
||||
print("setup-config called with %s" % " ".join(sys.argv))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user