Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-44227

HTML Publisher does show multiple HTML files for multi-configuration projects when using variables

    • Icon: Task Task
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • htmlpublisher-plugin
    • None

      Hi Team

      We are trying to use HTML publisher plugin to display multiple HTML files generated using multi configuration job, where we have specified the user defined axis as Application and have provided multiple values to it.
      It so happens is that when we run the application individually using a single job and call the param "Application" in the html index page it is able to fetch the correct value.
      But when we are trying to execute all the applications in parallel we are not able to fetch the values correctly.
      as it display "application= appname" against each run.

      Currently we have hardcoded the index pages and have provided the list of all files but what we are expecting is that we call the executed files using a variable in jenkins using multi config job.

      Thanks & Regards
      Naresh.G

       

       

          [JENKINS-44227] HTML Publisher does show multiple HTML files for multi-configuration projects when using variables

          Hi nareshg4 - I've had a quick attempt at recreating your issue with no luck but I wasn't sure exactly where you were seeing the issue. Are you able to show where the incorrect values are showing with a screenshot or similar? Also if you could provide the configuration you are using which has the issue that should help track down the issue. Thanks!

          Richard Bywater added a comment - Hi nareshg4 - I've had a quick attempt at recreating your issue with no luck but I wasn't sure exactly where you were seeing the issue. Are you able to show where the incorrect values are showing with a screenshot or similar? Also if you could provide the configuration you are using which has the issue that should help track down the issue. Thanks!

          Naresh G added a comment -

          Hi Richard

          What we were trying to do is to publish multiple HTML files using the HTML publisher. I am looking for a option where i can provide a param to call all the files to be published.

          For now what i have done is to just provide the names of all the files to be published, but this doesn't look like a good practice as the no. files are expected to increase by good no.

           

          Thanks

          Naresh G added a comment - Hi Richard What we were trying to do is to publish multiple HTML files using the HTML publisher. I am looking for a option where i can provide a param to call all the files to be published. For now what i have done is to just provide the names of all the files to be published, but this doesn't look like a good practice as the no. files are expected to increase by good no.   Thanks

          The Index page(s) field accepts environment variable substitution so if you can get the list of files that you want to publish into a parameter then it is just a matter of using that variable. For instance in a multi-configuration plugin if you wanted to use an user-defined axis called "Application" and have an HTML file with that name, then you could reference this in the Index page field with a value of "${Application}.html".

          If you are wanting to dynamically set the value in the build, then the EnvInject plugin (https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin) can come in useful in that you can add a build step that will read the contents of a Properties file and make that available as a variable. For instance you could have a file written out with the content of "HtmlReportFiles=index.html,first.html,second.html" and then use the EnvInject plugin to read that file and you can then use "${HtmlReportFiles}" in the Index page field to index those three pages.

          Is that the kind of behaviour you are looking for and if so does that satisfy your requirements?

          Richard Bywater added a comment - The Index page(s) field accepts environment variable substitution so if you can get the list of files that you want to publish into a parameter then it is just a matter of using that variable. For instance in a multi-configuration plugin if you wanted to use an user-defined axis called "Application" and have an HTML file with that name, then you could reference this in the Index page field with a value of "${Application}.html". If you are wanting to dynamically set the value in the build, then the EnvInject plugin ( https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin ) can come in useful in that you can add a build step that will read the contents of a Properties file and make that available as a variable. For instance you could have a file written out with the content of "HtmlReportFiles=index.html,first.html,second.html" and then use the EnvInject plugin to read that file and you can then use "${HtmlReportFiles}" in the Index page field to index those three pages. Is that the kind of behaviour you are looking for and if so does that satisfy your requirements?

          Closing this for inactivity for now. If you are still hitting issues please feel free to reopen this issue and/or make contact on the Jenkins User mailing list.

          Richard Bywater added a comment - Closing this for inactivity for now. If you are still hitting issues please feel free to reopen this issue and/or make contact on the Jenkins User mailing list.

            r2b2_nz Richard Bywater
            nareshg4 Naresh G
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: