在jenkins的emailext插件中找不到令牌

时间:2018-04-11 11:15:33

标签: jenkins jenkins-plugins jenkins-pipeline email-ext jenkins-email-ext

我试图在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=""}无效?

1 个答案:

答案 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"}'
        )
    }
}