我试图在jenkins中发送包含emailext插件的电子邮件。我的声明性管道的相关部分是:
post {
always {
emailext (
to: 'bar@foo.com',
subject: "${currentBuild.currentResult}: ${env.JOB_NAME} - build ${currentBuild.number}",
body: "${FILE, path="$WORKSPACE/results/summary.txt"}"
)
}
}
这会导致错误:
WorkflowScript: 53: unexpected token: FILE @ line 53, column 26.
body: "${FILE, path="$WORKSPACE/results/summary.txt"}"
为什么令牌${FILE, path=""}
无效?
答案 0 :(得分:1)
'
条目适用"
代替body
:
post {
always {
emailext (
to: 'bar@foo.com',
subject: "${currentBuild.currentResult}: ${env.JOB_NAME} - build ${currentBuild.number}",
body: '${FILE, path="$WORKSPACE/results/summary.txt"}'
)
}
}