Skip to content

Commit 0f03525

Browse files
yzheng6GitHub Enterprise
authored andcommitted
Add email notification (#821)
Email PR author and an ISCE3 maintainer when PR merge minimum workflow test fails or is unstable.
1 parent b72742c commit 0f03525

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.ci/jenkins/workflow-mintests/Jenkinsfile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,27 @@ pipeline {
129129
echo 'I succeeded!'
130130
}
131131
unstable {
132-
echo 'I am unstable :/'
132+
echo 'I am unstable :/ Emailing PR author and one of the ISCE3 maintainers.'
133+
emailStatus()
133134
}
134135
failure {
135-
echo 'I failed :('
136+
echo 'I failed :( Emailing PR author and one of the ISCE3 maintainers.'
137+
emailStatus()
136138
}
137139
changed {
138140
echo 'Things were different before...'
139141
}
140142
}
141143
}
144+
145+
def emailStatus() {
146+
mail to: '[email protected]',
147+
subject: "ISCE3 build ${currentBuild.result}: ${currentBuild.fullDisplayName}",
148+
body: "Minimum workflow test ${currentBuild.result}: ${env.BUILD_URL}"
149+
emailext(
150+
subject: "ISCE3 build ${currentBuild.result}: ${currentBuild.fullDisplayName}",
151+
body: "Minimum workflow test ${currentBuild.result}: ${env.BUILD_URL}",
152+
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
153+
)
154+
}
155+

0 commit comments

Comments
 (0)