Upated to sqential execution of versions
All checks were successful
LXC-ImageBuilder/Alpine/pipeline/head This commit looks good
All checks were successful
LXC-ImageBuilder/Alpine/pipeline/head This commit looks good
This commit is contained in:
66
Jenkinsfile
vendored
66
Jenkinsfile
vendored
@@ -1,3 +1,6 @@
|
||||
String[] ImgReleaseList = ['3.13', 'edge']
|
||||
String[] ImgVariantList = ['Default-minmal', 'Default-default']
|
||||
|
||||
pipeline {
|
||||
agent { label 'LXCBuilder' }
|
||||
parameters {
|
||||
@@ -21,49 +24,28 @@ pipeline {
|
||||
sh '''mkdir $WORKSPACE/REL'''
|
||||
}
|
||||
}
|
||||
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 {
|
||||
stage('Image Configs'){
|
||||
steps{
|
||||
script{
|
||||
for(ImgRelease in ImgReleaseList){
|
||||
for(ImgVariant in ImgVariantList){
|
||||
//ImgTypeTest
|
||||
anyOf {
|
||||
allOf {
|
||||
expression { return (env.ImgVariant).startsWith('Default-') }
|
||||
environment name: 'BuildDefault', value: 'true'
|
||||
if (env.BuildDefault == 'true' && (ImgVariant).startsWith('Default-')) {
|
||||
BuildThis = true
|
||||
} else if (env.BuildExtra == 'true' && (ImgVariant).startsWith('Extra-')) {
|
||||
BuildThis = true
|
||||
} else {
|
||||
BuildThis = false
|
||||
}
|
||||
allOf {
|
||||
expression { return (env.ImgVariant).startsWith('Extra-') }
|
||||
environment name: 'BuildExtra', value: 'true'
|
||||
}
|
||||
}
|
||||
}
|
||||
steps {
|
||||
// Build script
|
||||
//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') {
|
||||
sh '''echo "$(date) Do Build for $ImgRelease - $ImgVariant"
|
||||
ImgVariantName=${ImgVariant#Default-} && ImgVariantName=${ImgVariantName#Extra-}
|
||||
@@ -77,6 +59,8 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Finish') {
|
||||
steps {
|
||||
// Save generated files
|
||||
|
||||
Reference in New Issue
Block a user