jenkins/mmcImages: changed pipeline as bootloader is built with dev image

BugzID: 73966
Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
This commit is contained in:
Marc Mattmueller 2021-07-27 16:36:03 +02:00 committed by Gitea
parent c9caaba9ad
commit 69a7bdec43
1 changed files with 31 additions and 19 deletions

View File

@ -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"