William Petit
6c8b6ac4e3
All checks were successful
Cadoles/postgres-backup/pipeline/head This commit looks good
50 lines
1.2 KiB
Groovy
50 lines
1.2 KiB
Groovy
@Library('cadoles') _
|
|
|
|
pipeline {
|
|
agent {
|
|
dockerfile {
|
|
label 'docker'
|
|
filename 'Dockerfile'
|
|
dir 'misc/ci'
|
|
}
|
|
}
|
|
|
|
stages {
|
|
stage('Build and publish packages') {
|
|
when {
|
|
anyOf {
|
|
branch 'master'
|
|
branch 'nfpm-packaging'
|
|
}
|
|
}
|
|
steps {
|
|
script {
|
|
List<String> packagers = ['deb', 'rpm']
|
|
packagers.each { pkgr ->
|
|
sh "make NFPM_PACKAGER='${pkgr}' package"
|
|
}
|
|
|
|
List<String> attachments = sh(returnStdout: true, script: "find dist -type f -name '*.deb' -or -name '*.rpm' -or -name '*.ipk'").split(' ')
|
|
String releaseVersion = sh(returnStdout: true, script: "git describe --always | rev | cut -d '/' -f 1 | rev").trim()
|
|
|
|
String releaseBody = """
|
|
_Publication automatisée réalisée par Jenkins._ [Voir le job](${env.RUN_DISPLAY_URL})
|
|
"""
|
|
|
|
gitea.release('forge-jenkins', 'Cadoles', 'postgres-backup', [
|
|
'attachments': attachments,
|
|
'body': releaseBody,
|
|
'releaseName': "${releaseVersion}",
|
|
'releaseVersion': "${releaseVersion}"
|
|
])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
post {
|
|
always {
|
|
cleanWs()
|
|
}
|
|
}
|
|
} |