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

This commit is contained in:
2021-02-21 21:38:28 +01:00
parent aa10a694c8
commit 76bc03d537

61
Jenkinsfile vendored
View File

@@ -1,3 +1,6 @@
String[] ImgReleaseList = ['15.2', 'tumbleweed']
String[] ImgVariantList = ['Default-minmal', 'Default-default']
pipeline { pipeline {
agent { label 'LXCBuilder' } agent { label 'LXCBuilder' }
parameters { parameters {
@@ -21,48 +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 '15.2', 'tumbleweed' //ImgTypeTest
} if (env.BuildDefault == 'true' && (ImgVariant).startsWith('Default-')) {
axis { BuildThis = true
name 'ImgVariant' } else if (env.BuildExtra == 'true' && (ImgVariant).startsWith('Extra-')) {
values 'Default-minmal', 'Default-default' BuildThis = true
} } else {
BuildThis = false
} }
//Exclude unwanted conbinatinations //Exclude unwanted conbinatinations
excludes { if (ImgRelease == 'tumbleweed' && ImgVariant != 'Default-default' ){
exclude { BuildThis = false
axis {
name 'ImgRelease'
values 'tumbleweed'
} }
axis { //Check if this combinations shoud be build
name 'ImgVariant' if (BuildThis == true) {
notValues 'Default-default' env.ImgRelease = ImgRelease
} env.ImgVariant = ImgVariant
}
}
stages {
stage('Build image') { 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 {
// Build script
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"
if [ $ImgRelease = "tumbleweed" ] ; then YamlVer=Tumbleweed ; else YamlVer=Leap ; fi if [ $ImgRelease = "tumbleweed" ] ; then YamlVer=Tumbleweed ; else YamlVer=Leap ; fi
@@ -77,6 +60,8 @@ pipeline {
} }
} }
} }
}
}
stage('Finish') { stage('Finish') {
steps { steps {
// Save generated files // Save generated files