From 8aab1d6d5a69004f4a412c6606e028ee0488fdf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20L=C3=BCke?= Date: Thu, 18 Feb 2021 13:23:59 +0100 Subject: [PATCH] jenkins/vm: expect a FORMATS parameter which has a list of formats One Jenkins jobs for each image format caused a large overhead. Allow to build multiple image formats in one job. --- jenkins/vm.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/jenkins/vm.sh b/jenkins/vm.sh index 58cb17038a..3ae49522b2 100644 --- a/jenkins/vm.sh +++ b/jenkins/vm.sh @@ -43,16 +43,21 @@ img=src/flatcar_production_image.bin [[ "${img}.bz2" -nt "${img}" ]] && enter lbunzip2 -k -f "/mnt/host/source/${img}.bz2" -# If the format variable ends with _pro it's a Flatcar Pro image and it should -# be uploaded to the private bucket. -PRIVATE_UPLOAD_OPT="" -if [[ -z "${FORMAT##*_pro}" ]] +if [[ "${FORMATS}" = "" ]] then - PRIVATE_UPLOAD_OPT="--private" - UPLOAD_ROOT=${UPLOAD_PRIVATE_ROOT} + FORMATS="${FORMAT}" fi +for FORMAT in ${FORMATS}; do + # If the format variable ends with _pro it's a Flatcar Pro image and it should + # be uploaded to the private bucket. + PRIVATE_UPLOAD_OPT="" + if [[ -z "${FORMAT##*_pro}" ]] + then + PRIVATE_UPLOAD_OPT="--private" + UPLOAD_ROOT=${UPLOAD_PRIVATE_ROOT} + fi -script image_to_vm.sh \ + script image_to_vm.sh \ --board="${BOARD}" \ --format="${FORMAT}" \ --getbinpkg \ @@ -65,3 +70,4 @@ script image_to_vm.sh \ --upload_root="${UPLOAD_ROOT}" \ --upload \ ${PRIVATE_UPLOAD_OPT} +done