-
New Feature
-
Resolution: Fixed
-
Major
-
None
I'm generating some HTML reports per module within my project, so they are in multiple directories, but I'd like to publish them all as one page with tabs to each file. So the ability to specify one path and a comma separated list of files doesn't quite work. I'd rather be able to do
**\target\reports\fooTool*.html
and have all found HTML files on the publish page, one tab each named for the file name being presented.
[JENKINS-7139] HtmlPublisher should be able to handle wildcard paths to find multiple html files
Yea, pretty much rather than 2 fields of the directory and index pages, just one that is a fileset type specification, then each found file gets a tab.
I'm guessing there is some standard method to find filesets from this type of pattern as I specify this way for the Junit, cobertura, pmd, checkstyle, etc plugins
The problem with having only one field is that it is ambiguous which directories should be archived for publishing, since they aren't served out of the workspace as that is subject to change at any time and could be on a slave. Using your example of "*\target\reports\fooTool.html", in the simple case of that matching directly in the workspace, it doesn't know if it should archive the "reports" directory or the "target" directory. With the "**", it could also be at foo/bar/baz/target/reports/fooTool1.html, and then it is even more confusing. Is there a way to decide this that I am missing?
As a way to achieve what you want, you could create a meta-report directory in your workspace, and put all reports there (either by having the reporting tools write there or via a "mv */reports reportdir" executed as the last build step), and then list those each as an Index Page. In this case a wildcard could make a lot of sense in the index page area.
I was thinking to add the mv to the end of the build step, that wouldn't be too evil. So then at lest the wild card in the index page would suffice.
I just wanted to comment that you could achieve this now with HTML Publisher 1.0 + the EnvInject plugin. If you add a build step to generate the comma-separated string of files you want, and put it into an environment variable, you could use that in the HTML Publisher plugin. Not ideal but I wanted to document it as a workaround.
1.1 was just released (it may take up to 24 hours to appear), which supports ant syntax, could anyone let me know if that resolves this issue?
Having the option to list matching files would also be valuable in some cases; if I have 80 reports, I don't really want 80 tabs.
If anyone wants to give this a stab, there was a pull request at https://github.com/jenkinsci/htmlpublisher-plugin/pull/5 that had to be reverted as it caused https://issues.jenkins-ci.org/browse/JENKINS-16083. So it probably isn't a huge amount of work to fix the pull request and solve its regression.
Has there been any progress on adding back pattern support?
I have to deal with a directory that contains an version number and would like to simply use eg: "testresults-*/" as the directory (this would match a single directory in my case so I'm not sure if this is the correct request)
Br,
Christoph
Ant patterns are supported in 1.7, hitting the update center soon, check it out and let me know how it works
Apologies, indeed, there were regressions in normal report archiving that required a revert. If anyone wants to look at improving https://github.com/jenkinsci/htmlpublisher-plugin/pull/17, it shouldn't be too hard.
Can I sponsor/support this feature to get it implemented again?
This should be fixed in 1.19 when released in that the Index pages will now allow an Ant style wildcard.
Version 1.19 is out now (so should appear in update center soon). This adds ability for Ant style wildcards and hopefully should meet the requirements of this issue without the issue that happened in the previous implementation of it.
Unfortunately once again this change has had to be backed out as it breaks people who don't run the jobs on the Jenkins master. It will be reintroduced soon hopefully once the code is tweaked to pick up the file from the right place so please hang tight
In the meantime, you can write :
script { def docFiles dir ('build/docs/asciidoc/') { docFiles = findFiles glob: '**' } publishHTML target: [ allowMissing : false, alwaysLinkToLastBuild: false, keepAll : true, reportDir : 'build/docs/asciidoc/', reportFiles : docFiles.join(','), reportName : 'Documentation' ] }
Hi everyone - I believe I now have a fix for the issue that caused the rollback and I have now produced a beta release which it would be good to get people to have a play with and see if it meets their needs. To get the beta release (1.22-beta-1) you'll need to set your Jenkins Update Centre URL to https://updates.jenkins.io/experimental/update-center.json as documented at https://jenkins.io/doc/developer/publishing/releasing-experimental-updates/#using-the-experimental-update-center
I've only just released the beta version so I'd imagine it might take up to 24 hours or so to show up in the update centre. Once you've had a play, it would be great if you could report back here on how you got on. If you have jobs that use the previous "normal" way you can test all the better as I'd really like to get some real usage info before releasing it publicly again.
Thanks in advance
Hi again everyone. I've finally released this as v1.22 (apologies for the long delay - I actually thought I'd released it before Christmas but obviously not :/ ). The new version should show up in the next day or so depending on the Jenkins update centre update job.
How to pass report path dynamically?
ex: target/reports/<currentdate>/index.html
How can I ignore currentdate in reports path while publishing in Jenkins?
I think this sound reasonable. You want the wildcard to work in the "Index page[s]" field, and any matches are a tab?
If anyone wants to look at how a similar plugin expands wildcards, I'd happily accept a patch!