add jabber_notify function
This commit is contained in:
parent
a2673ac19a
commit
19caa233d5
|
@ -1,5 +1,17 @@
|
|||
package eo;
|
||||
|
||||
def jabber_notify(currentBuild, env, groupchat = null) {
|
||||
if (currentBuild.result == null || currentBuild.result == 'SUCCESS') {
|
||||
return;
|
||||
}
|
||||
message = "$currentBuild.fullDisplayName build failed: $currentBuild.absoluteUrl"
|
||||
if (env.GIT_BRANCH == 'origin/main' && groupchat) {
|
||||
sh("echo '$message' | sendxmpp -c $groupchat")
|
||||
} else {
|
||||
author = sh(returnStdout: true, script: "/usr/bin/git show -s --format='%ae' HEAD | sed s/@entrouvert.*//").trim()
|
||||
sh("echo '$message' | sendxmpp $author@im.libre-entreprise.com")
|
||||
}
|
||||
}
|
||||
|
||||
def mail_notify(currentBuild, env, email) {
|
||||
/* Send mail to 'email' if branch is main
|
||||
|
|
Loading…
Reference in New Issue