简体   繁体   English

Jenkins HTML 在构建级别发布,无需副本

[英]Jenkins HTML publishing on build level without copies

I am trying to publish HTML reports for each build .我正在尝试为每个构建发布 HTML 报告 I tried plugin HtmlPublisher (1.22) but when it publishes my reports on their build page (using keepAll=true ), it creates copies of reports from all previous builds in each build directory.我尝试了插件HtmlPublisher (1.22)但是当它在他们的构建页面上发布我的报告时(使用keepAll=true ),它会在每个构建目录中创建所有先前构建的报告副本。 So, each Jenkins build includes many copies of old reports and they are bigger and bigger.因此,每个 Jenkins 构建都包含许多旧报告的副本,并且它们越来越大。 If I publish my reports on the project page (using keepAll=false ), old reports are preserved in their project directory (in my file system) but only the last report is accessible from Jenkins.如果我在项目页面上发布我的报告(使用keepAll=false ),旧报告将保留在其项目目录中(在我的文件系统中),但 Jenkins 只能访问最后一个报告。 Is there any way how to have reports on their build pages without creation of their duplicates ?有什么方法可以在不创建重复项的情况下在其构建页面上生成报告? Maybe, there is some parameter that I'm still missing.也许,我仍然缺少一些参数。

My pipeline includes the following HtmlPublisher use:我的管道包括以下 HtmlPublisher 使用:

publishHTML (target: [
  allowMissing: false,
  alwaysLinkToLastBuild: false,
  keepAll: true,
  reportDir: "./htmlReports",
  reportFiles: reportFileNames, //generic variable
  reportName: "Results"
])

EDIT: It seems that the publishHTML publishes the whole directory ( reportDir ) not the files ( reportFiles ).编辑:似乎 publishHTML 发布了整个目录( reportDir )而不是文件( reportFiles )。 The files are used only for publishing wrapper (HTML generated by the publishHTML).这些文件仅用于发布包装器(由 publishHTML 生成的 HTML)。 So, when I generate my HTML artifacts to a shared directory for all builds, all files from this shared directory are copied to the build directory during publishing.因此,当我将 HTML 工件生成到所有构建的共享目录时,此共享目录中的所有文件都会在发布期间复制到构建目录。

Is there way how I can publish only specific files without archiving all files in directory?有没有办法只发布特定文件而不将所有文件归档到目录中?

Thank you谢谢

I guess that copying of the whole directory is because of possible resources of published HTML pages.我猜整个目录的复制是因为已发布的 HTML 页面的可能资源。 Therefore, all files are archived to (build/project) directory.因此,所有文件都归档到 (build/project) 目录。

The htmlPublisher provides optional parameter includes which allows to specify the archived files. htmlPublisher 提供可选参数包括允许指定存档文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM