2017-01-11 104 views
0

在我的Jenkins文件中,我使用publishHTML发布PIT的报告。我的步骤如下使用publishHTML无法识别Jenkins文件夹中的目录名的通配符

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. 

通配符***不起作用。如何在jenkins文件中使用通配符作为目录名称,并且在windows或unix上执行此操作时是否有区别?

回答

0

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

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

} 

对于那些有兴趣谁,我Jenkinsfile的完整版可以在我的github repo找到。

相关问题