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,32 +29,32 @@ 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 { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
// Build script sh '''echo "$(date) Do Build for $ImgRelease - $ImgVariant"
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { ImgVariantName${ImgVariant#Default-} && ImgVariantName${ImgVariantName#Extra-}
sh '''echo "$(date) Do Build for $ImgRelease - $ImgVariant" sudo $WORKSPACE/distrobuilder build-lxc Alpine.yaml $WORKSPACE/REL/$ImgRelease-$ImgVariant/ -o image.release=$ImgRelease -o image.variant=$ImgVariantName
ImgVariantName${ImgVariant#Default-} && ImgVariantName${ImgVariantName#Extra-} sudo chown jenkins:jenkins -R $WORKSPACE/REL
sudo $WORKSPACE/distrobuilder build-lxc Alpine.yaml $WORKSPACE/REL/$ImgRelease-$ImgVariant/ -o image.release=$ImgRelease -o image.variant=$ImgVariantName mv $WORKSPACE/REL/$ImgRelease-$ImgVariant/rootfs.tar.xz $ImgVariant-$ImgRelease.tar.xz
sudo chown jenkins:jenkins -R $WORKSPACE/REL '''
mv $WORKSPACE/REL/$ImgRelease-$ImgVariant/rootfs.tar.xz $ImgVariant-$ImgRelease.tar.xz
'''
}
} }
//} }
} }
} }
} }