Added jenkinsFile

This commit is contained in:
2021-02-19 02:54:43 +01:00
parent 882e5655ec
commit 86821c70b9
2 changed files with 68 additions and 11 deletions

68
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,68 @@
pipeline {
agent { label 'LXCBuilder' }
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'
}
}
}
}
options {
buildDiscarder(logRotator(numToKeepStr: '2', artifactNumToKeepStr: '1'))
}
stages {
stage('Prepare') {
steps {
// Get distrobuilder
copyArtifacts filter: 'bin/distrobuilder', fingerprintArtifacts: true, flatten: true, projectName: '/Public/DistroBuilder/BuildConfig=BrampCustom', selector: lastSuccessful()
}
}
stage('Build') {
steps {
copyArtifacts filter: 'bin/distrobuilder', fingerprintArtifacts: true, flatten: true, projectName: '/Public/DistroBuilder/BuildConfig=BrampCustom', selector: lastSuccessful()
// Build SH script
sh '''sudo $WORKSPACE/distrobuilder build-lxc Alpine.yaml ./ -o image.release=$ImgRelease -o image.variant=$ImgVariant
sudo chown jenkins:jenkins $WORKSPACE/*.tar.xz
'''
}
}
stage('Finish') {
steps {
// Save generated files
archiveArtifacts artifacts: '*.tar.xz', followSymlinks: false
// Cleaning WorkSpace
cleanWs()
}
}
}
post {
success {
echo 'Build successful'
}
failure {
echo 'Build Failed'
// Send To static addres
//emailext attachLog: true,body: '$DEFAULT_CONTENT', subject: '$DEFAULT_SUBJECT', to: 'bram@bprieshof.nl'
}
}
}

View File

@@ -1,11 +0,0 @@
ImgRelease:
- 3.13
- edge
ImgVariant:
- default
- extended
exclude:
- ImgRelease: edge
ImgVariant: extended