【发布时间】:2017-08-07 06:31:31
【问题描述】:
我有一个如下所示的管道脚本:
node {
try {
stage('Prepare') {
// git clone here
}
stage('Compile') {
sh "make ${build_type}"
}
stage('Test') {
sh "./run tests ${build_type}"
}
}
finally {
if (fileExists("test_results.xml")) {
junit "test_results.xml"
}
emailext subject: "Build finished",
body: '${JELLY_SCRIPT, template="some-template.template"}',
to: "some-one@somewhere"
}
}
${build_type} 可以是“发布”或“调试”。
当我的构建收到触发器时,我希望我的管道为 ${build_type} 中的每个参数运行一次,然后向我发送一封电子邮件,其中包含有关两个构建的报告。
我怎样才能做到这一点?
我尝试在 Compile 阶段定义一个并行块并在那里设置 build_type,但这不会使其他阶段并行运行。
【问题讨论】: