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

68
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 {
axes {
axis {
name 'ImgRelease'
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
anyOf {
allOf {
expression { return (env.ImgVariant).startsWith('Default-') }
environment name: 'BuildDefault', value: 'true'
}
allOf {
expression { return (env.ImgVariant).startsWith('Extra-') }
environment name: 'BuildExtra', value: 'true'
}
}
}
steps{ steps{
// Build script script{
for(ImgRelease in ImgReleaseList){
for(ImgVariant in ImgVariantList){
//ImgTypeTest
if (env.BuildDefault == 'true' && (ImgVariant).startsWith('Default-')) {
BuildThis = true
} else if (env.BuildExtra == 'true' && (ImgVariant).startsWith('Extra-')) {
BuildThis = true
} else {
BuildThis = false
}
//Exclude unwanted conbinatinations
// if (ImgRelease == 'buster' && ImgVariant == 'Default-default' ){
// BuildThis = false
// }
//Check if this combinations shoud be build
if (BuildThis == true) {
env.ImgRelease = ImgRelease
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