This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
passerelle-reunion-pastell/Jenkinsfile

48 lines
1.5 KiB
Plaintext
Raw Normal View History

2020-12-26 15:21:16 +01:00
@Library('eo-jenkins-lib@main') import eo.Utils
2019-10-16 07:46:17 +02:00
pipeline {
agent any
stages {
2019-10-16 15:07:39 +02:00
stage('Unit Tests') {
steps {
sh 'tox -rv'
}
post {
always {
junit '*_results.xml'
}
}
}
2019-10-16 07:46:17 +02:00
stage('Packaging') {
steps {
script {
env.SHORT_JOB_NAME=sh(
returnStdout: true,
// given JOB_NAME=gitea/project/PR-46, returns project
// given JOB_NAME=project/main, returns project
script: '''
echo "${JOB_NAME}" | sed "s/gitea\\///" | awk -F/ '{print $1}'
'''
).trim()
if (env.GIT_BRANCH == 'main' || env.GIT_BRANCH == 'origin/main') {
sh "sudo -H -u eobuilder /usr/local/bin/eobuilder -d bullseye ${SHORT_JOB_NAME}"
2019-10-16 07:46:17 +02:00
} else if (env.GIT_BRANCH.startsWith('hotfix/')) {
sh "sudo -H -u eobuilder /usr/local/bin/eobuilder -d bullseye --branch ${env.GIT_BRANCH} --hotfix ${SHORT_JOB_NAME}"
2019-10-16 07:46:17 +02:00
}
}
}
}
}
post {
always {
script {
utils = new Utils()
utils.mail_notify(currentBuild, env, 'ci+jenkins-passerelle-reunion-pastell@entrouvert.org')
}
}
success {
cleanWs()
}
}
}