Skip to content

Commit 6f9a09c

Browse files
author
Vaughn Dice
authored
Merge pull request #49 from vdice/add-email-notification
feat(Jenkinsfile): send email to slack
2 parents cd8ecc1 + 96a8fd6 commit 6f9a09c

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

Jenkinsfile

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,25 @@ waitUntil {
133133
build job: downstreamJob, parameters: [[$class: 'StringParameterValue', name: 'WORKFLOW_CLI_SHA', value: git_commit]]
134134
true
135135
} catch(error) {
136-
input "Retry the e2e tests?"
137-
false
136+
node('linux') {
137+
withCredentials([[$class: 'StringBinding', credentialsId: '8a727911-596f-4057-97c2-b9e23de5268d', variable: 'SLACKEMAIL']]) {
138+
mail body: """<!DOCTYPE html>
139+
<html>
140+
<head>
141+
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
142+
</head>
143+
<body>
144+
<div>Author: ${env.CHANGE_AUTHOR}<br/>
145+
Branch: ${env.BRANCH_NAME}<br/>
146+
Commit: ${env.CHANGE_TITLE}<br/>
147+
<p><a href="${env.BUILD_URL}console/">Click here</a> to view build logs.</p>
148+
<p><a href="${env.BUILD_URL}input/">Click here</a> to restart e2e.</p>
149+
</div>
150+
</html>
151+
""", from: 'jenkins@ci.deis.io', subject: 'Controller-sdk-go E2E Test Failure', to: env.SLACKEMAIL, mimeType: 'text/html'
152+
}
153+
}
154+
input "Retry the e2e tests?"
155+
false
138156
}
139157
}

0 commit comments

Comments
 (0)