Skip to content

Commit 6602479

Browse files
authored
Merge pull request #996 from jbtrystram/matrix-messages
utils: add helper to send matrix messages through maubot
2 parents 503fd4f + 8e19138 commit 6602479

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

jenkins/controller/plugins.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ splunk-devops-extend:1.10.1
3232
splunk-devops:1.10.1
3333
antisamy-markup-formatter:162.v0e6ec0fcfcf6
3434
jms-messaging:1.1.27
35-
matrix-communication:13.vdcfb_b_44ce852
3635

3736
# The below list are plugins that are also in base-plugins.txt but for
3837
# some reason or other we need to temporarily freeze or fast-track.

utils.groovy

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,4 +706,23 @@ def get_supported_additional_arches() {
706706
return supported
707707
}
708708

709+
// try sending a message on matrix through maubot
710+
def matrixSend(message) {
711+
712+
withCredentials([usernamePassword(credentialsId: 'matrix-bot-webhook-token',
713+
usernameVariable: 'MATRIX_WEBHOOK_URL',
714+
passwordVariable: 'TOKEN')]) {
715+
716+
shwrap("""
717+
curl -X POST -H "Content-Type: application/json" \
718+
-u $TOKEN $MATRIX_WEBHOOK_URL \
719+
--silent \
720+
-d '
721+
{
722+
"body": "$message"
723+
}'
724+
""")
725+
}
726+
}
727+
709728
return this

0 commit comments

Comments
 (0)