aboutsummaryrefslogtreecommitdiffstats
path: root/jjb/common/include-agl-run-test-prepare.sh
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2020-03-24 10:08:54 +0100
committerCorentin LABBE <clabbe@baylibre.com>2020-03-27 09:30:04 +0100
commit47533a77f8826718e7f79cce01ec9bc1e03bfadb (patch)
tree358f0c2899f5d15fe1df258f80e61ed4187a0fe3 /jjb/common/include-agl-run-test-prepare.sh
parentc78d5cb2dabb9600e50e082ea6a8e0de74bb292a (diff)
SPEC-2962: permit to have more than one board per build
The current way to generate jobs assume that only one board exists per build. For handing more than one board per build, we need to introduce a sort of loop. So for each build, we will produce a list of boards in BOARDOUT In the BOARDOUT/$board, we will have: - an "info" file with all necessary VARIABLES for copying artifacts So for each board, some artifact will be copied. Then only one job for the "main" board of the CIBT job will be handled. The extra boards of a build will need to have their own CIBT, but at least they dont need to do a real build/copyartifact. Change-Id: I6c6999e549c7f1216f466410896b3058efc5882d Signed-off-by: Corentin LABBE <clabbe@baylibre.com>
Diffstat (limited to 'jjb/common/include-agl-run-test-prepare.sh')
-rw-r--r--jjb/common/include-agl-run-test-prepare.sh133
1 files changed, 86 insertions, 47 deletions
diff --git a/jjb/common/include-agl-run-test-prepare.sh b/jjb/common/include-agl-run-test-prepare.sh
index 56d99c8a..cb5be40e 100644
--- a/jjb/common/include-agl-run-test-prepare.sh
+++ b/jjb/common/include-agl-run-test-prepare.sh
@@ -20,59 +20,98 @@ if [ -e releng-scripts/utils ]; then
RELENG=$PWD/releng-scripts
fi
-declare -A agl_lava_releng_aliases
-agl_lava_releng_aliases=(
- [raspberrypi3]="bcm2837-rpi-3-b-32;raspberrypi3"
- [raspberrypi4]="bcm2711-rpi-4-b;raspberrypi4"
- [qemux86-64]="qemu;qemux86-64"
- [qemuarm]="qemu;qemuarm"
- [qemuarm64]="qemu;qemuarm64"
- [m3ulcb-nogfx]="r8a7796-m3ulcb;m3ulcb"
- [h3ulcb-nogfx]="r8a7795-h3ulcb-kf;h3ulcb-kf"
- [porter-nogfx]="renesas-porter;porter"
- [dra7xx-evm]="dra7-evm;dra7xx-evm"
- [intel-corei7-64]="upsquare;upsquare"
-)
+# WARNING: we need gen_info in last, the device of the current JENKINS CIBT
+# example: for x86, the JENKINS CIBT job is for "qemu" and produce artifacts for all x86 boards.
+# so we need to gen_info for qemux86 and upsquare, this content will be used to copy artifacts just after.
+# but the LAVA job need to be generated only for qemu. So we need to have lava_device and releng_device for it.
+export BOARDOUT=$(mktemp --directory)
+case $MACHINE in
+qemux86-64)
+ lava_device=upsquare
+ releng_device=upsquare
+ gen_info || exit 0
+ lava_device=qemu
+ releng_device=qemux86-64
+ gen_info || exit 0
+;;
+raspberrypi4)
+ lava_device=bcm2711-rpi-4-b
+ releng_device=raspberrypi4
+ gen_info || exit 0
+;;
+qemuarm)
+ lava_device=qemu
+ releng_device=qemuarm
+ gen_info || exit 0
+;;
+qemuarm64)
+ lava_device=qemu
+ releng_device=qemuarm64
+ gen_info || exit 0
+;;
+h3ulcb-nogfx)
+ lava_device=r8a7795-h3ulcb-kf
+ releng_device=h3ulcb-kf
+ gen_info || exit 0
+;;
+upsquare)
+ lava_device=upsquare
+ releng_device=upsquare
+ # NO gen_info since, we use artifacts of the qemux86_64 CIBT
+;;
+*)
+ echo "ERROR: unknown machine $MACHINE"
+ exit 0
+;;
+esac
-OFS=${IFS}
-IFS=';'
-arr=(${agl_lava_releng_aliases[$MACHINE]})
-IFS=${OFS}
-lava_device=${arr[0]}
-releng_device=${arr[1]}
-# And agl_device=${MACHINE}
+#gen board info in $BOARDOUT
+gen_info() {
+ if [ -z "${lava_device}" -o -z "${releng_device}" ]; then
+ echo "Board not supported: $MACHINE"
+ return 1
+ fi
-if [ -z "${lava_device}" -o -z "${releng_device}" ]; then
- echo "Board not supported: $MACHINE"
- exit 0
-fi
+ CREATE_ARGS=""
+ CREATE_ARGS+="--machine ${releng_device} "
-CREATE_ARGS=""
-CREATE_ARGS+="--machine ${releng_device} "
+ if [[ $TARGETBRANCH ]] && [[ x"master" != x"$TARGETBRANCH" ]] ; then
+ CREATE_ARGS+="--branch $TARGETBRANCH "
+ fi
-if [[ $TARGETBRANCH ]] && [[ x"master" != x"$TARGETBRANCH" ]] ; then
-CREATE_ARGS+="--branch $TARGETBRANCH "
-fi
+ # If it's a release build
+ if [[ $RELEASE_BRANCH ]] && [[ $RELEASE_VERSION ]]; then
+ CREATE_ARGS+="--build-type release $RELEASE_BRANCH $RELEASE_VERSION "
+ fi
+ # If it's a CI build
+ if [[ $GERRIT_CHANGE_NUMBER ]] && [[ $GERRIT_PATCHSET_NUMBER ]]; then
+ CREATE_ARGS+="--build-type ci $GERRIT_CHANGE_NUMBER $GERRIT_PATCHSET_NUMBER "
+ fi
-# If it's a release build
-if [[ $RELEASE_BRANCH ]] && [[ $RELEASE_VERSION ]]; then
- CREATE_ARGS+="--build-type release $RELEASE_BRANCH $RELEASE_VERSION "
-fi
-# If it's a CI build
-if [[ $GERRIT_CHANGE_NUMBER ]] && [[ $GERRIT_PATCHSET_NUMBER ]]; then
- CREATE_ARGS+="--build-type ci $GERRIT_CHANGE_NUMBER $GERRIT_PATCHSET_NUMBER "
-fi
+ $RELENG/utils/job-prereq.py ${CREATE_ARGS}
+ if [ $? -ne 0 ]; then
+ echo "Board not supported by releng-scripts: job-prereq.py"
+ return 1
+ fi
+ # First call to job-prereq suceeded, other should suceed as they use the same args.
+ export DEVICE_DTB=`$RELENG/utils/job-prereq.py ${CREATE_ARGS} --dtb`
+ export DEVICE_KERNEL=`$RELENG/utils/job-prereq.py ${CREATE_ARGS} --kernel`
+ export DEVICE_INITRAMFS=`$RELENG/utils/job-prereq.py ${CREATE_ARGS} --initrd`
+ export DEVICE_NBDROOT=`$RELENG/utils/job-prereq.py ${CREATE_ARGS} --nbdroot`
+ # thoses variables (DEVICE_DTB DEVICE_KERNEL DEVICE_INITRAMFS DEVICE_NBDROOT) are only used for copying artifacts later
-$RELENG/utils/job-prereq.py ${CREATE_ARGS}
-if [ $? -ne 0 ]; then
- echo "Board not supported by releng-scripts: job-prereq.py"
- exit 0
-fi
-# First call to job-prereq suceeded, other should suceed as they use the same args.
-export DEVICE_DTB=`$RELENG/utils/job-prereq.py ${CREATE_ARGS} --dtb`
-export DEVICE_KERNEL=`$RELENG/utils/job-prereq.py ${CREATE_ARGS} --kernel`
-export DEVICE_INITRAMFS=`$RELENG/utils/job-prereq.py ${CREATE_ARGS} --initrd`
-export DEVICE_NBDROOT=`$RELENG/utils/job-prereq.py ${CREATE_ARGS} --nbdroot`
+ mkdir -p $BOARDOUT/
+ # We use both lava_device and releng_device for handling name collision (like qemu)
+ BDIRNAME="$lava_device-$releng_device"
+ echo "DEVICE_DTB=$DEVICE_DTB" > $BOARDOUT/$BDIRNAME/info
+ echo "DEVICE_KERNEL=$DEVICE_KERNEL" >> $BOARDOUT/$BDIRNAME/info
+ echo "DEVICE_INITRAMFS=$DEVICE_INITRAMFS" >> $BOARDOUT/$BDIRNAME/info
+ echo "DEVICE_NBDROOT=$DEVICE_NBDROOT" >> $BOARDOUT/$BDIRNAME/info
+ # thoses two variable are only for debugging
+ echo "x_releng_device=$releng_device" >> $BOARDOUT/$BDIRNAME/info
+ echo "x_lava_device=$lava_device" >> $BOARDOUT/$BDIRNAME/info
+ return 0
+}
# echo NEXT is rsync
#exit 0