参数化工程
选择String parameter,这里会输入接收者,可以多选用分号隔开;

在Pipeline中定义参数

parameters {
string(name: 'Receiver_Email', defaultValue: 'xx@yourEmail.com', description: 'Add some receiver email adress')
}
Post 中调用参数

post {
success {
script {
echo "Build successful"
}
}
failure {
script {
echo "Build failed"
}
}
always {
// Send email if the ZIP file does not exist
script {
echo "Sending email due to missing ${MODEL_NAME}_CodeFiles.zip"
emailext (
subject: "Compilation Error Notification",
body: "The MATLAB model compilation has failed. Please check the logs.",
to: " ${Receiver_Email}"
)
}
}
}
}
704

被折叠的 条评论
为什么被折叠?



