summaryrefslogtreecommitdiffstats
path: root/Jenkinsfile
blob: cdb43492bb475f92c68f1b4a5971a821198cb240 (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
40
41
42
@Library('eo-jenkins-lib@main') import eo.Utils

pipeline {
    agent any
    options {
        disableConcurrentBuilds()
    }
    stages {
        stage('Unit Tests') {
            steps {
                sh 'tox -rv'
            }
            post {
                always {
                    mergeJunitResults()
                }
            }
        }
        stage('Packaging') {
            steps {
                script {
                    if (env.JOB_NAME == 'combo-plugin-imio-townstreet' && env.GIT_BRANCH == 'origin/main') {
                        sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder -d buster,bullseye combo-plugin-imio-townstreet'
                    } else if (env.GIT_BRANCH.startsWith('hotfix/')) {
                        sh "sudo -H -u eobuilder /usr/local/bin/eobuilder -d buster,bullseye --branch ${env.GIT_BRANCH} --hotfix combo-plugin-imio-townstreet"
                    }
                }
            }
        }
    }
    post {
        always {
            script {
                utils = new Utils()
                utils.mail_notify(currentBuild, env, 'ci+jenkins-combo-plugin-imio-townstreet@entrouvert.org')
            }
        }
        success {
            cleanWs()
        }
    }
}