summaryrefslogtreecommitdiffstats
path: root/Jenkinsfile
blob: b3ee5c31a5cedcbb09ac9a99a49cc7afe2ac2938 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
@Library('eo-jenkins-lib@main') import eo.Utils

pipeline {
    agent any
    stages {
        stage('Unit Tests') {
            steps {
                sh 'tox -r'
            }
            post {
                always {
                    junit '*_results.xml'
                }
            }
        }
        stage('Packaging') {
            steps {
                script {
                    if (env.JOB_NAME == 'mail2redmine' && env.GIT_BRANCH == 'origin/main') {
                        sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder -d stretch mail2redmine'
                    } else if (env.GIT_BRANCH.startsWith('hotfix/')) {
                        sh "sudo -H -u eobuilder /usr/local/bin/eobuilder -d stretch --branch ${env.GIT_BRANCH} --hotfix mail2redmine"
                    }
                }
            }
        }
    }
    post {
        always {
            script {
                utils = new Utils()
                utils.mail_notify(currentBuild, env, 'ci+jenkins-mail2redmine@entrouvert.org')
            }
        }
        success {
            cleanWs()
        }
    }
}