Added comments

This commit is contained in:
2021-02-21 03:33:36 +01:00
parent 8782e0cf51
commit e1ce5de359
2 changed files with 17 additions and 15 deletions

2
Jenkinsfile vendored
View File

@@ -33,6 +33,7 @@ pipeline {
values 'Default-default', 'Extra-extended' values 'Default-default', 'Extra-extended'
} }
} }
//Exclude unwanted conbinatinations
excludes { excludes {
exclude { exclude {
axis { axis {
@@ -49,6 +50,7 @@ pipeline {
stages { stages {
stage('Build image') { stage('Build image') {
when { when {
//ImgTypeTest
anyOf { anyOf {
allOf { allOf {
expression { return (env.ImgVariant).startsWith('Default-') } expression { return (env.ImgVariant).startsWith('Default-') }

View File

@@ -29,22 +29,23 @@ pipeline {
script{ script{
for(ImgRelease in ImgReleaseList){ for(ImgRelease in ImgReleaseList){
for(ImgVariant in ImgVariantList){ for(ImgVariant in ImgVariantList){
//ImgTypeTest
if (env.BuildDefault == 'true' && (ImgVariant).startsWith('Default-')) { if (env.BuildDefault == 'true' && (ImgVariant).startsWith('Default-')) {
echo 'Building Default'
BuildThis = true BuildThis = true
} else if (env.BuildExtra == 'true' && (ImgVariant).startsWith('Extra-')) { } else if (env.BuildExtra == 'true' && (ImgVariant).startsWith('Extra-')) {
BuildThis = true BuildThis = true
echo 'Building Extra'
} else { } else {
BuildThis = false BuildThis = false
echo 'not building'
} }
//Exclude unwanted conbinatinations
if (ImgRelease == 'edge' && ImgVariant == 'Extra-extended' ){
BuildThis = false
}
//Check if this combinations shoud be build
if (BuildThis == true) { if (BuildThis == true) {
env.ImgRelease = ImgRelease env.ImgRelease = ImgRelease
env.ImgVariant = ImgVariant env.ImgVariant = ImgVariant
stage('Build image') { stage('Build image') {
// 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"
ImgVariantName${ImgVariant#Default-} && ImgVariantName${ImgVariantName#Extra-} ImgVariantName${ImgVariant#Default-} && ImgVariantName${ImgVariantName#Extra-}
@@ -54,7 +55,6 @@ pipeline {
''' '''
} }
} }
//}
} }
} }
} }