summaryrefslogtreecommitdiffstats
path: root/src/eo/Utils.groovy
blob: 100a3f2e7305c90e5235cc97ed9c0526d561751d (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
47
48
49
50
51
52
package eo;


def mail_notify(currentBuild, env, email) {
    /* Send mail to 'email' if branch is master
     else send mail to the author of the last commit
     */
    if (currentBuild.result == null) {
        // Hack to have the 'jenkins build back to normal' mail sent
        currentBuild.result = 'SUCCESS'
    }
    if (env.GIT_BRANCH == 'origin/master') {
        step([
            $class: 'Mailer', notifyEveryUnstableBuild: true,
            recipients: email, sendToIndividuals: true
        ])
    } else {
        author = sh(returnStdout: true, script: "/usr/bin/git show -s --format='%ae' HEAD").trim()
        step([
            $class: 'Mailer', notifyEveryUnstableBuild: true,
            recipients: author, sendToIndividuals: true
        ])
    }
}


def publish_coverage(report_pattern) {
    step([
        $class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false,
         coberturaReportFile: report_pattern, failUnhealthy: false, failUnstable: false,
         maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false
    ])
}


def publish_coverage_native(report_pattern) {
    publishHTML target : [
        allowMissing: false, alwaysLinkToLastBuild: false, keepAll: true, reportDir: 'htmlcov',
        reportFiles: report_pattern, reportName: 'Coverage Report (native)',reportTitles: ''
    ]
}


def publish_pylint(report_pattern) {
    warnings canComputeNew: false, canResolveRelativePaths: false, categoriesPattern: '',
        defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '',
        messagesPattern: '', parserConfigurations: [[parserName: 'PyLint', pattern: report_pattern]],
        unHealthy: ''
}


return this