Upated to sqential execution of versions
All checks were successful
LXC-ImageBuilder/Alpine/pipeline/head This commit looks good

This commit is contained in:
2021-02-21 21:38:26 +01:00
parent 9454e7ad47
commit 29451f86e6

66
Jenkinsfile vendored
View File

@@ -1,3 +1,6 @@
String[] ImgReleaseList = ['3.13', 'edge']
String[] ImgVariantList = ['Default-minmal', 'Default-default']
pipeline { pipeline {
agent { label 'LXCBuilder' } agent { label 'LXCBuilder' }
parameters { parameters {
@@ -21,49 +24,28 @@ pipeline {
sh '''mkdir $WORKSPACE/REL''' sh '''mkdir $WORKSPACE/REL'''
} }
} }
stage("Image Configs") { stage('Image Configs'){
matrix { steps{
axes { script{
axis { for(ImgRelease in ImgReleaseList){
name 'ImgRelease' for(ImgVariant in ImgVariantList){
values '3.13', 'edge'
}
axis {
name 'ImgVariant'
values 'Default-minmal', 'Default-default'
}
}
// //Exclude unwanted conbinatinations
// excludes {
// exclude {
// axis {
// name 'ImgRelease'
// values 'edge'
// }
// axis {
// name 'ImgVariant'
// //use notValues to invert
// values 'Extra-extended'
// }
// }
// }
stages {
stage('Build image') {
when {
//ImgTypeTest //ImgTypeTest
anyOf { if (env.BuildDefault == 'true' && (ImgVariant).startsWith('Default-')) {
allOf { BuildThis = true
expression { return (env.ImgVariant).startsWith('Default-') } } else if (env.BuildExtra == 'true' && (ImgVariant).startsWith('Extra-')) {
environment name: 'BuildDefault', value: 'true' BuildThis = true
} else {
BuildThis = false
} }
allOf { //Exclude unwanted conbinatinations
expression { return (env.ImgVariant).startsWith('Extra-') } // if (ImgRelease == 'buster' && ImgVariant == 'Default-default' ){
environment name: 'BuildExtra', value: 'true' // BuildThis = false
} // }
} //Check if this combinations shoud be build
} if (BuildThis == true) {
steps { env.ImgRelease = ImgRelease
// Build script env.ImgVariant = ImgVariant
stage('Build image') {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh '''echo "$(date) Do Build for $ImgRelease - $ImgVariant" sh '''echo "$(date) Do Build for $ImgRelease - $ImgVariant"
ImgVariantName=${ImgVariant#Default-} && ImgVariantName=${ImgVariantName#Extra-} ImgVariantName=${ImgVariant#Default-} && ImgVariantName=${ImgVariantName#Extra-}
@@ -77,6 +59,8 @@ pipeline {
} }
} }
} }
}
}
stage('Finish') { stage('Finish') {
steps { steps {
// Save generated files // Save generated files