-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
44 lines (39 loc) · 1.02 KB
/
Jenkinsfile
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
@Library('jenkins-shared-libs-oop')
import org.jbris.Git
import org.jbris.Email
import org.jbris.Bats
def git = new Git(this)
def email = new Email(this)
def bats = new Bats(this)
pipeline {
agent any
stages {
stage('announce-test') {
steps {
script {
sh 'echo "Jenkins Pipeline"'
git.getLatestCommit()
}
}
}
stage('test') {
steps {
script {
bats.test("${WORKSPACE}/tests/tests.bats", "${WORKSPACE}/test_results.tap")
}
}
}
}
post {
always {
script {
if (fileExists("test_results.xml")) {
archiveArtifacts artifacts: "test_results.xml", fingerprint: true
}
bats.publishResults("test_results.tap")
email.sendResults("\${DEFAULT_RECIPIENTS}")
}
deleteDir()
}
}
}