【发布时间】:2018-01-24 12:25:24
【问题描述】:
我使用 Jenkins 2.63 和 Slack Notifier 插件 2.2
我需要通过 Job DSL 使用 SlackNotifier 生成作业,但我无法在 DSL 中设置 Base URL,我收到以下消息:
错误:(脚本,第 145 行)没有方法签名:baseUrl() 适用于参数类型:(java.lang.String) 值:[https://my.domain.slack.com/services/hooks/jenkins-ci/] 可能的解决方案:authToken( ), authTokenCredentialId(), botUser(), commitInfoChoice(), customMessage(), includeCustomMessage(), includeTestSummary(), notifyAborted(), notifyBackToNormal(), notifyFailure(), notifyNotBuilt(), notifyRegression(), notifyRepeatedFailure(), notifySuccess(), notifyUnstable(), room(), sendAs(), startNotification(), teamDomain() 完成:失败
这是我的 DSL 脚本
publishers {
def slackParam = new groovy.json.JsonSlurper().parse(new File(channelFile))
slackNotifier {
baseUrl(slackParam.url)
authTokenCredentialId(slackParam.authTokenCredentialId)
includeTestSummary(true)
notifyAborted(true)
notifyBackToNormal(true)
notifyFailure(true)
notifyNotBuilt(true)
notifyRegression(true)
notifyRepeatedFailure(true)
notifyUnstable(true)
room(slackParam.room)
}
}
但是在job config.xml中我可以找到这个参数。
谁能帮我设置基本 URL 参数?
非常感谢。
【问题讨论】: