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:
parent
c9caaba9ad
commit
69a7bdec43
|
|
@ -74,11 +74,21 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
build(params.IMAGE_TYPE)
|
build(params.IMAGE_TYPE)
|
||||||
createArchive(params.IMAGE_TYPE, env.IMG_OUTPUT_DIR)
|
|
||||||
if(params.IMAGE_TYPE != 'bootloader') {
|
// archive a bootloader package:
|
||||||
archiveOSTreeArtifact(env.IMG_OUTPUT_DIR)
|
// 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 {
|
post {
|
||||||
|
|
@ -107,7 +117,7 @@ pipeline {
|
||||||
} // stages
|
} // stages
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
def printJobParameters() {
|
def printJobParameters() {
|
||||||
println "----------------------------------\n\
|
println "----------------------------------\n\
|
||||||
Job Parameters:\n\
|
Job Parameters:\n\
|
||||||
|
|
@ -120,25 +130,26 @@ def printJobParameters() {
|
||||||
----------------------------------\n"
|
----------------------------------\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
def build(imgType) {
|
def build(imgType) {
|
||||||
if(imgType == 'bootloader') {
|
def tgtImgType = "${imgType}" == "bootloader" ? "dev" : "${imgType}"
|
||||||
sh "bash -c '. ./env.image-ostree && bitbake virtual/bootloader'"
|
def imgTypePostfix = "${tgtImgType}" == "" ? "" : "-${tgtImgType}"
|
||||||
return
|
|
||||||
}
|
|
||||||
def imgTypePostfix = "${imgType}" == "" ? "" : "-${imgType}"
|
|
||||||
sh "bash -c '. ./env.image-ostree && bitbake -k netmodule-linux-image${imgTypePostfix}'"
|
sh "bash -c '. ./env.image-ostree && bitbake -k netmodule-linux-image${imgTypePostfix}'"
|
||||||
}
|
}
|
||||||
|
|
||||||
def createArchive(imgType, outputDir) {
|
//-----------------------------------------------------------------------------
|
||||||
dir (outputDir) {
|
def createBslPackage(outputDir) {
|
||||||
if(imgType == 'bootloader') {
|
dir(outputDir) {
|
||||||
sh "cp ${env.YOCTO_DEPLOYS}/*u-boot-${params.MACHINE}*.img . || true"
|
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}/*u-boot-${params.MACHINE}*.xmodem.bin . || true"
|
||||||
sh "cp ${env.YOCTO_DEPLOYS}/imx-boot . || true"
|
sh "cp ${env.YOCTO_DEPLOYS}/imx-boot . || true"
|
||||||
sh "cp ${env.YOCTO_DEPLOYS}/imx-boot.sd . || true"
|
sh "cp ${env.YOCTO_DEPLOYS}/imx-boot.sd . || true"
|
||||||
return
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
def createImagePackage(imgType, outputDir) {
|
||||||
|
dir (outputDir) {
|
||||||
def imgTypePostfix = "${imgType}" == "" ? "" : "-${imgType}"
|
def imgTypePostfix = "${imgType}" == "" ? "" : "-${imgType}"
|
||||||
def image_basename = "netmodule-linux-image${imgTypePostfix}-${params.MACHINE}"
|
def image_basename = "netmodule-linux-image${imgTypePostfix}-${params.MACHINE}"
|
||||||
def basename_built = "${env.YOCTO_DEPLOYS}/${image_basename}"
|
def basename_built = "${env.YOCTO_DEPLOYS}/${image_basename}"
|
||||||
|
|
@ -164,6 +175,7 @@ def createArchive(imgType, outputDir) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
def archiveOSTreeArtifact(outputDir) {
|
def archiveOSTreeArtifact(outputDir) {
|
||||||
archiveArtifacts artifacts: "${outputDir}/ostree_repo*.tar.gz", onlyIfSuccessful: true
|
archiveArtifacts artifacts: "${outputDir}/ostree_repo*.tar.gz", onlyIfSuccessful: true
|
||||||
sh "rm -f ./${outputDir}/ostree_repo*.tar.gz"
|
sh "rm -f ./${outputDir}/ostree_repo*.tar.gz"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue