Try building in paralell
This commit is contained in:
67
Jenkinsfile-Sequential
Normal file
67
Jenkinsfile-Sequential
Normal file
@@ -0,0 +1,67 @@
|
||||
pipeline {
|
||||
agent { label 'LXCBuilder' }
|
||||
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") {
|
||||
matrix {
|
||||
axes {
|
||||
axis {
|
||||
name 'ImgRelease'
|
||||
values '3.13', 'edge'
|
||||
}
|
||||
axis {
|
||||
name 'ImgVariant'
|
||||
values 'default', 'extended'
|
||||
}
|
||||
}
|
||||
excludes {
|
||||
exclude {
|
||||
axis {
|
||||
name 'ImgRelease'
|
||||
values 'edge'
|
||||
}
|
||||
axis {
|
||||
name 'ImgVariant'
|
||||
notValues 'default'
|
||||
}
|
||||
}
|
||||
}
|
||||
// all the stages here will run in parallel
|
||||
parallel {
|
||||
stage('Build image') {
|
||||
steps {
|
||||
echo "Do Build for ${$ImgRelease} - ${ImgVariant}"
|
||||
// Build script
|
||||
sh '''sudo $WORKSPACE/distrobuilder build-lxc Alpine.yaml $WORKSPACE/REL/$ImgRelease-$ImgVariant/ -o image.release=$ImgRelease -o image.variant=$ImgVariant
|
||||
sudo chown jenkins:jenkins -R $WORKSPACE/REL
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Finish') {
|
||||
steps {
|
||||
// Save generated files
|
||||
archiveArtifacts artifacts: 'REL/**', followSymlinks: false
|
||||
// Cleaning WorkSpace
|
||||
//cleanWs()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user