summaryrefslogtreecommitdiffstats
path: root/Jenkinsfile
blob: b129ac812cf46ea26910d5990d2ef74580976445 (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
43
44
45
46
@Library('eo-jenkins-lib@master') import eo.Utils

pipeline {
    agent any
    options { disableConcurrentBuilds() }
    stages {
        stage('Unit Tests') {
            steps {
                sh 'tox -rv'
            }
            post {
                always {
                    script {
                        utils = new Utils()
                        utils.publish_coverage('coverage.xml')
                        utils.publish_coverage_native('index.html')
                        utils.publish_pylint('pylint.out')
                    }
                    junit '*_results.xml'
                }
            }
        }
        stage('Packaging') {
            steps {
                script {
                    if (env.JOB_NAME == 'welco' && env.GIT_BRANCH == 'origin/master') {
                        sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder welco'
                    } else if (env.GIT_BRANCH.startsWith('hotfix/')) {
                        sh "sudo -H -u eobuilder /usr/local/bin/eobuilder -d stretch --branch ${env.GIT_BRANCH} --hotfix welco"
                    }
                }
            }
        }
    }
    post {
        always {
            script {
                utils = new Utils()
                utils.mail_notify(currentBuild, env, 'admin+jenkins-welco@entrouvert.com')
            }
        }
        success {
            cleanWs()
        }
    }
}