evobackup/.Jenkinsfile
David Prevot 2d21eec7b1
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
gitea.evolix.org on plain agent00/evobackup/pipeline/head There was a failure building this commit
CI: More env var
2022-06-23 13:46:39 +02:00

74 lines
2.6 KiB
Plaintext

pipeline {
agent { label 'gbp' }
options {
// This is required to clean up before build
skipDefaultCheckout(true)
}
stages {
stage("Env Variables") {
steps {
sh "printenv | sort"
}
}
stage('Build Debian package') {
when {
branch 'wip-debian'
}
steps {
// Clean before build
cleanWs()
script {
// 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/dprevot/evobackup.git']]
])
echo "scmVars"
env.GIT_COMMIT = scmVars.GIT_COMMIT
env.GIT_BRANCH = scmVars.GIT_BRANCH
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']])
}
}
}