1

我正在尝试使用 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=""}不起作用?

4

1 回答 1

2

它适用于而'不是条目:"body

post {
    always {
        emailext (
            to: 'bar@foo.com',
            subject: "${currentBuild.currentResult}: ${env.JOB_NAME} - build ${currentBuild.number}",
            body: '${FILE, path="$WORKSPACE/results/summary.txt"}'
        )
    }
}
于 2018-04-11T11:59:25.220 回答