Yas*_*ash 5 jenkins jenkins-pipeline
我正在设置一个Jenkins管道,我想将帖子构建通知发送给多个接收器.我无法找到如何设置"CC",有人可以帮助.
我的管道的一个例子如下:
pipeline {
agent any
stages {
stage('No-op') {
steps {
sh 'ls'
}
}
}
post {
failure {
mail to: 'team@example.com',
subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
body: "Something is wrong with ${env.BUILD_URL}"
}
}
Run Code Online (Sandbox Code Playgroud)
}
以上示例对我来说工作正常,但我想修改以下行以向多人发送通知(最好在CC中):
mail to: 'team@example.com',
Run Code Online (Sandbox Code Playgroud)
我正在使用Jenkins ver.2.41
我不知道你是否可以CC它们,但要发送给多个收件人尝试使用逗号分隔列表:
mail to: 'team@example.com,blah@example.com',
Run Code Online (Sandbox Code Playgroud)
使用代码段生成器探索有关大多数步骤的更多选项。你可以CC甚至BCC喜欢:
管道命令:
mail bcc: 'foo@example.com', body: 'Test CC Pipeline', cc: 'xyz@example.com', from: '', replyTo: '', subject: 'Testing CC', to: 'abc@example.com'
Run Code Online (Sandbox Code Playgroud)
对于emailext脚本,请在以下部分cc中使用:to
emailext body: 'testing',subject: 'testing', to: 'xyz@example.com,cc:abc@example.com'
Run Code Online (Sandbox Code Playgroud)
参考:https ://issues.jenkins-ci.org/plugins/servlet/mobile#issus/JENKINS-6703
| 归档时间: |
|
| 查看次数: |
5162 次 |
| 最近记录: |