0
我有一個管道腳本,看起來像這樣:如何使用jenkins中的不同參數運行相同的管道?
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: "[email protected]"
}
}
$ {} build_type可以 「釋放」 或 「調試」。
當我生成接收到觸發,我想我的管道在$ {} build_type每個參數運行一次,然後給我一份報告,關於這兩個構建一個電子郵件。
我該如何做到這一點?
我試圖在Compile階段內定義一個並行塊並在其中設置build_type,但這不會使其他階段並行運行。