Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
187 views
in Technique[技术] by (71.8m points)

Configuring Jenkins Job Notifications in DSL job file

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...