Jenkins: Send emails to last committer only

This commit is contained in:
Johannes Schnatterer
2018-07-12 10:32:24 +02:00
parent 5697c850f3
commit b4a0578ad3

11
Jenkinsfile vendored
View File

@@ -56,7 +56,7 @@ node() { // No specific label
// Find maven warnings and visualize in job
warnings consoleParsers: [[parserName: 'Maven']], canRunOnFailed: true
mailIfStatusChanged(defaultEmailRecipients)
mailIfStatusChanged(commitAuthorEmail)
}
void analyzeWith(Maven mvn) {
@@ -85,3 +85,12 @@ void analyzeWith(Maven mvn) {
mvn "${mvnArgs}"
}
}
String getCommitAuthorComplete() {
new Sh(this).returnStdOut 'hg log --branch . --limit 1 --template "{author}"'
}
String getCommitAuthorEmail() {
def matcher = getCommitAuthorComplete() =~ "<(.*?)>"
matcher ? matcher[0][1] : ""
}