From 69a7bdec43b37b9c0703101f9838d99663da4c3d Mon Sep 17 00:00:00 2001 From: Marc Mattmueller Date: Tue, 27 Jul 2021 16:36:03 +0200 Subject: [PATCH] jenkins/mmcImages: changed pipeline as bootloader is built with dev image BugzID: 73966 Signed-off-by: Marc Mattmueller --- Jenkinsfile_mmcImages | 50 +++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/Jenkinsfile_mmcImages b/Jenkinsfile_mmcImages index b8b2f7f..c545787 100644 --- a/Jenkinsfile_mmcImages +++ b/Jenkinsfile_mmcImages @@ -74,11 +74,21 @@ pipeline { steps { script { build(params.IMAGE_TYPE) - createArchive(params.IMAGE_TYPE, env.IMG_OUTPUT_DIR) - if(params.IMAGE_TYPE != 'bootloader') { - archiveOSTreeArtifact(env.IMG_OUTPUT_DIR) + + // archive a bootloader package: + // the bootloader is also built with the dev image, hence we combine it + if((params.IMAGE_TYPE == 'bootloader') || (params.IMAGE_TYPE == 'dev')) { + createBslPackage(env.IMG_OUTPUT_DIR) + yoctocommon.archiveImages(env.IMG_OUTPUT_DIR) + } + + // archive an image package: + // skip for bootloader only builds + if(params.IMAGE_TYPE != 'bootloader') { + createImagePackage(params.IMAGE_TYPE, env.IMG_OUTPUT_DIR) + archiveOSTreeArtifact(env.IMG_OUTPUT_DIR) + yoctocommon.archiveImages(env.IMG_OUTPUT_DIR) } - yoctocommon.archiveImages(env.IMG_OUTPUT_DIR) } } post { @@ -107,7 +117,7 @@ pipeline { } // stages } - +//----------------------------------------------------------------------------- def printJobParameters() { println "----------------------------------\n\ Job Parameters:\n\ @@ -120,25 +130,26 @@ def printJobParameters() { ----------------------------------\n" } +//----------------------------------------------------------------------------- def build(imgType) { - if(imgType == 'bootloader') { - sh "bash -c '. ./env.image-ostree && bitbake virtual/bootloader'" - return - } - def imgTypePostfix = "${imgType}" == "" ? "" : "-${imgType}" + def tgtImgType = "${imgType}" == "bootloader" ? "dev" : "${imgType}" + def imgTypePostfix = "${tgtImgType}" == "" ? "" : "-${tgtImgType}" sh "bash -c '. ./env.image-ostree && bitbake -k netmodule-linux-image${imgTypePostfix}'" } -def createArchive(imgType, outputDir) { - dir (outputDir) { - if(imgType == 'bootloader') { - sh "cp ${env.YOCTO_DEPLOYS}/*u-boot-${params.MACHINE}*.img . || true" - sh "cp ${env.YOCTO_DEPLOYS}/*u-boot-${params.MACHINE}*.xmodem.bin . || true" - sh "cp ${env.YOCTO_DEPLOYS}/imx-boot . || true" - sh "cp ${env.YOCTO_DEPLOYS}/imx-boot.sd . || true" - return - } +//----------------------------------------------------------------------------- +def createBslPackage(outputDir) { + dir(outputDir) { + sh "cp ${env.YOCTO_DEPLOYS}/*u-boot-${params.MACHINE}*.img . || true" + sh "cp ${env.YOCTO_DEPLOYS}/*u-boot-${params.MACHINE}*.xmodem.bin . || true" + sh "cp ${env.YOCTO_DEPLOYS}/imx-boot . || true" + sh "cp ${env.YOCTO_DEPLOYS}/imx-boot.sd . || true" + } +} +//----------------------------------------------------------------------------- +def createImagePackage(imgType, outputDir) { + dir (outputDir) { def imgTypePostfix = "${imgType}" == "" ? "" : "-${imgType}" def image_basename = "netmodule-linux-image${imgTypePostfix}-${params.MACHINE}" def basename_built = "${env.YOCTO_DEPLOYS}/${image_basename}" @@ -164,6 +175,7 @@ def createArchive(imgType, outputDir) { } } +//----------------------------------------------------------------------------- def archiveOSTreeArtifact(outputDir) { archiveArtifacts artifacts: "${outputDir}/ostree_repo*.tar.gz", onlyIfSuccessful: true sh "rm -f ./${outputDir}/ostree_repo*.tar.gz"