This repository has been archived by the owner on Oct 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
40 lines (39 loc) · 1.45 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
pipeline {
agent any
stages {
stage('Build Dockerfile') {
steps {
/* `docker build` returns non-zero on test failures,
* Command builds the Dockerfile checking the syntax and functional errors of the Golang project
*/
sh 'docker build ./dldata/dockerfiles/darklist_blacklist'
}
}
stage('Remove Docker Images') {
steps {
/* 'docker rmi' returns non-zero on test failures,
* Command deletes all docker images to clean the Jenkins server
*/
sh 'docker system prune -f'
}
}
}
post {
changed {
script {
if (currentBuild.currentResult == 'FAILURE') { // Other values: SUCCESS, UNSTABLE
// Send an email only if the build status has changed from green/unstable to red
emailext subject: '$DEFAULT_SUBJECT',
body: '$DEFAULT_CONTENT',
recipientProviders: [
[$class: 'CulpritsRecipientProvider'],
[$class: 'DevelopersRecipientProvider'],
[$class: 'RequesterRecipientProvider']
],
replyTo: '$DEFAULT_REPLYTO',
to: 'liamjosephkeenan@gmail.com'
}
}
}
}
}