CI: Update .Jenkinsfile
Some checks failed
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
gitea.evolix.org on plain agent00/evobackup/pipeline/head There was a failure building this commit

This commit is contained in:
David Prevot 2022-06-23 11:38:34 +02:00
parent cbecbe80b7
commit 2166a1e946

View file

@ -1,21 +1,45 @@
pipeline {
agent { label 'docker' }
agent { label 'gbp' }
options {
// This is required to clean up before build
skipDefaultCheckout(true)
}
stages {
stage('Build Debian package') {
agent {
docker {
image 'evolix/gbp:latest'
args '-v /tmp:/tmp'
}
stage("Env Variables") {
steps {
sh "printenv | sort"
}
}
stage('Build Debian package') {
when {
branch 'debian'
branch 'wip-debian'
}
steps {
// Clean before build
cleanWs()
script {
sh 'mk-build-deps --install --remove debian/control'
sh 'git clean --force'
sh 'gbp buildpackage'
// Explicitly checkout from SCM after clean up
def scmVars = checkout([
$class: 'GitSCM',
branches: [[name: '*/wip-debian']],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'source']],
submoduleCfg: [],
userRemoteConfigs: [[url: 'https://gitea.evolix.org/evolix/evobackup.git']]
])
echo "scmVars.GIT_COMMIT"
env.GIT_COMMIT = scmVars.GIT_COMMIT
sh "echo Building ${env.JOB_NAME}..."
sh 'printenv | sort'
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'
}
}
}
@ -34,4 +58,16 @@ pipeline {
}
}
}
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']])
}
}
}