evobackup/.Jenkinsfile
David Prevot 4d2a3841af CI: cfix
2022-06-22 15:46:09 +02:00

58 lines
1.9 KiB
Plaintext

pipeline {
agent { label 'gbp' }
options {
// This is required to clean up before build
skipDefaultCheckout(true)
}
stages {
stage('Build Debian package') {
when {
branch 'wip-debian'
}
steps {
// Clean before build
cleanWs()
// Explicitly checkout from SCM after clean up
checkout scm
script {
sh 'echo "Building ${env.JOB_NAME}..."'
sh '/usr/bin/generate-git-snapshot'
sh '/usr/bin/build-and-provide-package'
/* Lintian */
sh 'mkdir -p report'
/* For the source package */
sh '/usr/bin/lintian-junit-report *.dsc > report/lintian.xml'
/* For the binary package */
sh '/usr/bin/lintian-junit-report *.changes >> report/lintian.xml'
}
}
}
stage('Upload Debian package') {
when {
branch 'debian'
}
steps {
script {
sh 'echo Dummy line to remove once something actually happens.'
/* No crendentials yet
sh 'rsync -avP /tmp/bkctld/ droneci@pub.evolix.net:/home/droneci/bkctld/'
*/
}
}
}
}
post {
// Clean after build
always {
archiveArtifacts artifacts: '*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes,*.buildinfo,lintian.txt'
cleanWs(cleanWhenNotBuilt: false,
deleteDirs: true,
disableDeferredWipeout: true,
notFailBuild: true,
patterns: [[pattern: '.gitignore', type: 'INCLUDE'],
[pattern: '.propsfile', type: 'EXCLUDE']])
}
}
}