Added debian 11
Some checks failed
LXC-ImageBuilder/Debian/pipeline/head There was a failure building this commit
Some checks failed
LXC-ImageBuilder/Debian/pipeline/head There was a failure building this commit
This commit is contained in:
156
Jenkinsfile
vendored
156
Jenkinsfile
vendored
@@ -1,79 +1,79 @@
|
||||
String[] ImgReleaseList = ['buster', 'jessie']
|
||||
String[] ImgVariantList = ['Default-minmal', 'Default-default', 'Extra-imgbuilder']
|
||||
|
||||
pipeline {
|
||||
agent { label 'LXCBuilder' }
|
||||
triggers {
|
||||
cron '@monthly'
|
||||
}
|
||||
parameters {
|
||||
booleanParam defaultValue: true, description: 'Builds Default images', name: 'BuildDefault'
|
||||
booleanParam defaultValue: false, description: 'Builds Extra images', name: 'BuildExtra'
|
||||
}
|
||||
options {
|
||||
skipDefaultCheckout()
|
||||
buildDiscarder(logRotator(numToKeepStr: '2', artifactNumToKeepStr: '1'))
|
||||
}
|
||||
stages {
|
||||
stage('Prepare') {
|
||||
steps {
|
||||
// Cleanup before starting
|
||||
cleanWs()
|
||||
// Checkout the repository
|
||||
checkout scm
|
||||
// Get distrobuilder
|
||||
copyArtifacts filter: 'bin/distrobuilder', fingerprintArtifacts: true, flatten: true, projectName: '/Public/DistroBuilder/BuildConfig=BrampCustom', selector: lastSuccessful()
|
||||
// Setup Env
|
||||
sh '''mkdir $WORKSPACE/REL'''
|
||||
}
|
||||
}
|
||||
stage('Image Configs'){
|
||||
steps{
|
||||
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 == 'jessie' && ImgVariant == 'Default-minmal' ){
|
||||
BuildThis = true
|
||||
}else if (ImgRelease == 'jessie' ){
|
||||
BuildThis = false
|
||||
}
|
||||
|
||||
//Check if this combinations shoud be build
|
||||
if (BuildThis == true) {
|
||||
env.ImgRelease = ImgRelease
|
||||
env.ImgVariant = ImgVariant
|
||||
stage('Build image') {
|
||||
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
||||
sh '''echo "$(date) Do Build for $ImgRelease - $ImgVariant"
|
||||
ImgVariantName=${ImgVariant#Default-} && ImgVariantName=${ImgVariantName#Extra-}
|
||||
sudo $WORKSPACE/distrobuilder build-lxc Debian.yaml $WORKSPACE/REL/$ImgRelease-$ImgVariant/ -o image.release=$ImgRelease -o image.variant=$ImgVariantName
|
||||
sudo chown jenkins:jenkins -R $WORKSPACE/REL
|
||||
mv $WORKSPACE/REL/$ImgRelease-$ImgVariant/rootfs.tar.xz Debian-$ImgRelease-$ImgVariant.tar.xz
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Finish') {
|
||||
steps {
|
||||
// Save generated files
|
||||
archiveArtifacts artifacts: '*.tar.xz', followSymlinks: false
|
||||
// Cleaning WorkSpace
|
||||
//cleanWs()
|
||||
}
|
||||
}
|
||||
}
|
||||
String[] ImgReleaseList = ['bullseye', 'buster', 'jessie']
|
||||
String[] ImgVariantList = ['Default-minmal', 'Default-default', 'Extra-imgbuilder']
|
||||
|
||||
pipeline {
|
||||
agent { label 'LXCBuilder' }
|
||||
triggers {
|
||||
cron '@monthly'
|
||||
}
|
||||
parameters {
|
||||
booleanParam defaultValue: true, description: 'Builds Default images', name: 'BuildDefault'
|
||||
booleanParam defaultValue: false, description: 'Builds Extra images', name: 'BuildExtra'
|
||||
}
|
||||
options {
|
||||
skipDefaultCheckout()
|
||||
buildDiscarder(logRotator(numToKeepStr: '2', artifactNumToKeepStr: '1'))
|
||||
}
|
||||
stages {
|
||||
stage('Prepare') {
|
||||
steps {
|
||||
// Cleanup before starting
|
||||
cleanWs()
|
||||
// Checkout the repository
|
||||
checkout scm
|
||||
// Get distrobuilder
|
||||
copyArtifacts filter: 'bin/distrobuilder', fingerprintArtifacts: true, flatten: true, projectName: '/Public/DistroBuilder/BuildConfig=BrampCustom', selector: lastSuccessful()
|
||||
// Setup Env
|
||||
sh '''mkdir $WORKSPACE/REL'''
|
||||
}
|
||||
}
|
||||
stage('Image Configs'){
|
||||
steps{
|
||||
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 == 'jessie' && ImgVariant == 'Default-minmal' ){
|
||||
BuildThis = true
|
||||
}else if (ImgRelease == 'jessie' ){
|
||||
BuildThis = false
|
||||
}
|
||||
|
||||
//Check if this combinations shoud be build
|
||||
if (BuildThis == true) {
|
||||
env.ImgRelease = ImgRelease
|
||||
env.ImgVariant = ImgVariant
|
||||
stage('Build image') {
|
||||
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
||||
sh '''echo "$(date) Do Build for $ImgRelease - $ImgVariant"
|
||||
ImgVariantName=${ImgVariant#Default-} && ImgVariantName=${ImgVariantName#Extra-}
|
||||
sudo $WORKSPACE/distrobuilder build-lxc Debian.yaml $WORKSPACE/REL/$ImgRelease-$ImgVariant/ -o image.release=$ImgRelease -o image.variant=$ImgVariantName
|
||||
sudo chown jenkins:jenkins -R $WORKSPACE/REL
|
||||
mv $WORKSPACE/REL/$ImgRelease-$ImgVariant/rootfs.tar.xz Debian-$ImgRelease-$ImgVariant.tar.xz
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Finish') {
|
||||
steps {
|
||||
// Save generated files
|
||||
archiveArtifacts artifacts: '*.tar.xz', followSymlinks: false
|
||||
// Cleaning WorkSpace
|
||||
//cleanWs()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user