So I want Jenkins to ping me on Webex Teams whenever a job fails. All Jenkins build configurations are done via DSL file(which overrides the manual changes in Jenkins UI), so I used the below to make the notifications work:
endpoint(‘WEBEX TEAMS URL’, ‘HTTP’, ‘JSON’) {
event(‘failed’)
loglines(0)
timeout(30000)
}
However, now I want to hide the webex teams URL. I have created a credential on Jenkins of type secret text. But how do I reference that credential??
I tried the below but it didn't work :(
wrappers {
credentialsBinding {
string(‘JENKINS-BOT’, ‘jenkins-bot-url’)
}
}
endpoint($JENKINS-BOT, ‘HTTP’, ‘JSON’) {
event(‘failed’)
loglines(0)
timeout(30000)
}
question from:
https://stackoverflow.com/questions/65848660/configuring-jenkins-job-notifications-in-dsl-job-file 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…