我想要发布html文件,可能在我的文件夹中我得到了多个文件,因此我将函数定义如下:
dir("${WORKSPACE}/reports/${testScope}-${team}") {
unstash "${testScope}-${team}-test-report"
htmlFiles = findFiles glob: '*.html'
}
publishHTML(target: [
allowMissing : false,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "${WORKSPACE}/reports/${testScope}-${team}/test/results/report/",
reportFiles : htmlFiles.join(','),
reportName : "${testScope}-${team}",
reportTitles : "${testScope} ${team} Test report"
])这是发布我的文件夹中的所有文件,即使是xml文件,我的代码有问题吗?
发布于 2021-03-31 18:20:51
如何调整这个答案:What's publishHtml reportFiles parameter syntax
publishHTML([
reportName: 'Newman Report'
reportDir: 'reports',
reportFiles: "${dir('reports') { findFiles(glob: '**/*.html').join(',') ?: 'Not found' }}",
allowMissing: true,
alwaysLinkToLastBuild: true,
keepAll: true,
])dir()闭包直接用于G-字符串内,作为分配给参数reportFiles的值。
https://stackoverflow.com/questions/66892890
复制相似问题