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 { pipeline {
agent { label 'docker' } agent { label 'gbp' }
options {
// This is required to clean up before build
skipDefaultCheckout(true)
}
stages { stages {
stage('Build Debian package') { stage("Env Variables") {
agent { steps {
docker { sh "printenv | sort"
image 'evolix/gbp:latest'
args '-v /tmp:/tmp'
}
} }
}
stage('Build Debian package') {
when { when {
branch 'debian' branch 'wip-debian'
} }
steps { steps {
// Clean before build
cleanWs()
script { script {
sh 'mk-build-deps --install --remove debian/control' // Explicitly checkout from SCM after clean up
sh 'git clean --force' def scmVars = checkout([
sh 'gbp buildpackage' $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']])
}
}
} }