【问题标题】:Wildcard for directory name in Jenkinsfile using publishHTML not recognizedJenkinsfile中使用publishHTML的目录名称通配符无法识别
【发布时间】:2017-01-11 10:00:08
【问题描述】:

在我的 Jenkinsfile 中,我使用 publishHTML 来发布 PIT 的报告。我的步骤如下

stage('Results') {
  publishHTML([allowMissing: false, alwaysLinkToLastBuild: false,
     keepAll: false, reportDir: 'target/pit-reports/*/', reportFiles: 'index.html', reportName: 'PIT Report'])
}

index.html 的目录类似于\target\pit-reports\201612081633。最后一部分201612081633 当然每次都不同。在 windows 机器上使用target/pit-reports/*/ 会导致以下错误。

ERROR: Specified HTML directory 'D:\David\Tools\Jenkins\workspace\jenkinsSandbox\target\pit-reports\*' does not exist.

通配符*** 不起作用。如何在 jenkinsfile 中使用通配符作为目录名称,在 windows 或 unix 上执行此操作有什么区别?

【问题讨论】:

    标签: windows unix jenkinsfile pitest


    【解决方案1】:

    我使用解决方法解决了这个问题,因为 publishHTML 插件似乎无法处理 ***。我现在用-DtimestampedReports=false org.pitest:pitest-maven:mutationCoverage 运行pitest,它禁用了带时间戳的文件夹。结果步骤现在如下所示。

    stage('Results') {
    publishHTML([allowMissing: false,
                 alwaysLinkToLastBuild: true,
                 keepAll: true,
                 reportDir: 'target/pit-reports',
                 reportFiles: 'index.html',
                 reportName: 'PIT Report'
                 ])
    
    }
    

    有兴趣的朋友可以在我的github repo找到我的完整版Jenkinsfile。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-05-24
      • 2019-04-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多