首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Jenkins htmlPublish函数:所有文件都已发布,其中不包括html文件。

Jenkins htmlPublish函数:所有文件都已发布,其中不包括html文件。
EN

Stack Overflow用户
提问于 2021-03-31 17:55:13
回答 1查看 214关注 0票数 0

我想要发布html文件,可能在我的文件夹中我得到了多个文件,因此我将函数定义如下:

代码语言:javascript
复制
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文件,我的代码有问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-03-31 18:20:51

如何调整这个答案:What's publishHtml reportFiles parameter syntax

代码语言:javascript
复制
publishHTML([
  reportName: 'Newman Report'
  reportDir: 'reports',
  reportFiles: "${dir('reports') { findFiles(glob: '**/*.html').join(',') ?: 'Not found' }}",
  allowMissing: true,
  alwaysLinkToLastBuild: true,
  keepAll: true,
])

dir()闭包直接用于G-字符串内,作为分配给参数reportFiles的值。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66892890

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档