Skip to content

Commit 5615bb4

Browse files
feat(ci): send emails to slack on e2e failure (#133)
1 parent 32177aa commit 5615bb4

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
@@ -134,7 +134,25 @@ waitUntil {
134134
}
135135
true
136136
} catch(error) {
137-
input "Retry the e2e tests?"
138-
false
137+
node('linux') {
138+
withCredentials([[$class: 'StringBinding', credentialsId: '8a727911-596f-4057-97c2-b9e23de5268d', variable: 'SLACKEMAIL']]) {
139+
mail body: """<!DOCTYPE html>
140+
<html>
141+
<head>
142+
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
143+
</head>
144+
<body>
145+
<div>Author: ${env.CHANGE_AUTHOR}<br/>
146+
Branch: ${env.BRANCH_NAME}<br/>
147+
Commit: ${env.CHANGE_TITLE}<br/>
148+
<a href="${env.BUILD_URL}console">Click here</a> to view logs.</p>
149+
<a href="${env.BUILD_URL}input/">Click here</a> to restart e2e.</p>
150+
</div>
151+
</html>
152+
""", from: 'jenkins@ci.deis.io', subject: 'Workflow CLI E2E Test Failure', to: env.SLACKEMAIL, mimeType: 'text/html'
153+
}
154+
}
155+
input "Retry the e2e tests?"
156+
false
139157
}
140158
}

0 commit comments

Comments
 (0)