From 93596b73a17e9f230187a4b89b5be79c58396396 Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Thu, 9 Sep 2021 22:52:08 +0000 Subject: [PATCH] Update 'DebIMG.jenkinsfile' --- DebIMG.jenkinsfile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/DebIMG.jenkinsfile b/DebIMG.jenkinsfile index 6e7ea76..fc28d44 100644 --- a/DebIMG.jenkinsfile +++ b/DebIMG.jenkinsfile @@ -2,6 +2,10 @@ String[] ImgVariantList = ['minmal', 'default', 'jenkinsbuilder', 'imgbuilder', pipeline { agent { label 'LXCBuilder' } + parameters { + booleanParam description: 'Enable muticore support for ZX compression ', name: 'ZX_Multicore' + string defaultValue: '0', description: 'Set amount of core\'s ZX is allowed when compressing (use 0 for all cores)', name: 'ZX_Cores' + } options { skipDefaultCheckout() buildDiscarder(logRotator(numToKeepStr: '2', artifactNumToKeepStr: '1')) @@ -25,12 +29,16 @@ pipeline { steps{ script{ for(ImgVariant in ImgVariantList){ + env.ZX_Multicore = ZX_Multicore + env.ZX_Cores = ZX_Cores env.ImgVariant = ImgVariant stage('Build image') { catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { sh '''echo "$(date) Do Build for $ImgVariant" - - sudo $WORKSPACE/distrobuilder build-lxc Debian.yaml $WORKSPACE/REL/$ImgVariant/ -o image.variant=$ImgVariantName + if $ZX_Multicore; then + export XZ_DEFAULTS="-T $ZX_Cores" + fi + sudo $WORKSPACE/distrobuilder build-lxc Debian.yaml $WORKSPACE/REL/$ImgVariant/ -o image.variant=$ImgVariant sudo chown jenkins:jenkins -R $WORKSPACE/REL mv $WORKSPACE/REL/$ImgVariant/rootfs.tar.xz Debian-$ImgVariant.tar.xz '''