gpt4 book ai didi

continuous-integration - 在步骤中找不到这样的 DSL 方法 'steps'

转载 作者:行者123 更新时间:2023-12-05 07:19:30 27 4
gpt4 key购买 nike

每当 CI 使用 groovy 脚本失败时,我都会尝试发布到 Slack channel 。但是当我尝试在失败 block 中实现这个时,我得到了这个错误

Error when executing failure post condition:
java.lang.NoSuchMethodError: No such DSL method 'steps' found among steps [archive, bat, build, catchError, checkout, deleteDir, dir, dockerFingerprintFrom, dockerFingerprintRun, echo, envVarsForTool, error, fileExists, getContext, git, input, isUnix, junit, library, libraryResource, load, lock, mail, milestone, node, parallel

但是,我能够应用相同的代码在阶段 block 下的其他管道中发送 Slack 通知。似乎在应用于帖子 block 时出现问题。

post {
always {
cleanWs()
}
failure {
steps {
slackSend baseUrl: 'https://hooks.slack.com/services/',
channel: '#build-failures',
iconEmoji: '',
message: "CI failing for - #${env.BRANCH_NAME} - ${currentBuild.currentResult} (<${env.BUILD_URL}|Open>)",
teamDomain: 'differentau',
tokenCredentialId: 'slack-token-build-failures',
username: ''
}
}
}

最佳答案

这应该有效:

post {
always {
cleanWs()
}
failure {
slackSend baseUrl: 'https://hooks.slack.com/services/',
channel: '#build-failures',
iconEmoji: '',
message: "CI failing for - #${env.BRANCH_NAME} - ${currentBuild.currentResult} (<${env.BUILD_URL}|Open>)",
teamDomain: 'differentau',
tokenCredentialId: 'slack-token-build-failures',
username: ''
}
}

关于continuous-integration - 在步骤中找不到这样的 DSL 方法 'steps',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57752088/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com