-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJenkinsfile
34 lines (31 loc) · 870 Bytes
/
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
@Library('slack-notifier') _
pipeline {
agent any
tools {
maven 'Maven 3.3.9'
jdk 'jdk8'
}
environment {
SLACK_HOOK = credentials('slack-hook')
}
stages {
stage('test') {
steps {
sh 'printenv'
sh 'mvn test -Dmaven.test.failure.ignore=true'
}
post {
always {
junit 'target/surefire-reports/*.xml'
script {
def attachments = resultNotifier.generateTestResultAttachment(this)
def imageAttachments = attachments.get(0)
imageAttachments.put('thumb_url', "https://raw.githubusercontent.com/hjnilsson/country-flags/master/png100px/ar.png")
attachments.set(0, imageAttachments)
resultNotifier.notifySlack("", "jenkins-builds", attachments, "${SLACK_HOOK}")
}
}
}
}
}
}