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

Possibility to use environment variables or parameters

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • htmlpublisher-plugin
    • None
    • Jenkins 1.419
      HTML Publisher 0.6

      Add the possibility to use environment variables ($BUILD_NUMBER, ...) or parameters ($PARAMETER1, ...) in fields "HTML directory to archive", "Index page[s]" or "Report title".

          [JENKINS-10273] Possibility to use environment variables or parameters

          mcrooney added a comment -

          This should be fixed in HTML Publisher 1.0, which was just released, so once it appears in your updates, please give it a shot and let me know!

          There are two caveats: it doesn't know about axes from multi-configuration projects (I filed https://issues.jenkins-ci.org/browse/JENKINS-13738 for this), and it doesn't work in the Report Title for now, as that's a little trickier due to how the titles are displayed. Please file a new bug if that's important.

          mcrooney added a comment - This should be fixed in HTML Publisher 1.0, which was just released, so once it appears in your updates, please give it a shot and let me know! There are two caveats: it doesn't know about axes from multi-configuration projects (I filed https://issues.jenkins-ci.org/browse/JENKINS-13738 for this), and it doesn't work in the Report Title for now, as that's a little trickier due to how the titles are displayed. Please file a new bug if that's important.

          Anton Ilyin added a comment -

          I just trying to use env. var. but fail.
          I get
          "[htmlpublisher] Archiving HTML reports...
          [htmlpublisher] Archiving at BUILD level d:\hudson\jobs\WebStudio_SmokeTest\workspace\TESTS\trunk\org.openl.rules.integration.tests\TestReports%BUILD_ID%(%BUILD_NUMBER%) to d:\hudson\jobs\WebStudio_SmokeTest\builds\2012-07-04_17-45-10\htmlreports\Smoke_Test_Results
          ERROR: Specified HTML directory 'd:\hudson\jobs\WebStudio_SmokeTest\workspace\TESTS\trunk\org.openl.rules.integration.tests\TestReports%BUILD_ID%(%BUILD_NUMBER%)' does not exist.
          "

          Anton Ilyin added a comment - I just trying to use env. var. but fail. I get " [htmlpublisher] Archiving HTML reports... [htmlpublisher] Archiving at BUILD level d:\hudson\jobs\WebStudio_SmokeTest\workspace\TESTS\trunk\org.openl.rules.integration.tests\TestReports%BUILD_ID%(%BUILD_NUMBER%) to d:\hudson\jobs\WebStudio_SmokeTest\builds\2012-07-04_17-45-10\htmlreports\Smoke_Test_Results ERROR: Specified HTML directory 'd:\hudson\jobs\WebStudio_SmokeTest\workspace\TESTS\trunk\org.openl.rules.integration.tests\TestReports%BUILD_ID%(%BUILD_NUMBER%)' does not exist. "

          mcrooney added a comment -

          The correct syntax would be $VARIABLE as used elsewhere, as opposed to %VARIABLE%. I'll update the description.

          mcrooney added a comment - The correct syntax would be $VARIABLE as used elsewhere, as opposed to %VARIABLE%. I'll update the description.

          Anton Ilyin added a comment -

          oK, thnaks a lot.

          Anton Ilyin added a comment - oK, thnaks a lot.

          mcrooney added a comment -

          I don't believe this issue should still be open but if anyone is experiencing problems, please let me know, thanks!

          mcrooney added a comment - I don't believe this issue should still be open but if anyone is experiencing problems, please let me know, thanks!

          Sille Kyatha added a comment - - edited

          I'm still unable to use environment variables, I'm using HTML plugin version 1.11 and Jenkins version 2.7.1

          [htmlpublisher] Archiving HTML reports...
          [htmlpublisher] Archiving at PROJECT level C:\Jenkins\workspace\Colleague_API\Colleague_Platform_API to /var/lib/jenkins/jobs/SunilKumar_POC/jobs/Colleague_API/jobs/CP_API_JUNIT_TEST/htmlreports/HTML_Report_${BUILD_NUMBER}

          Sille Kyatha added a comment - - edited I'm still unable to use environment variables, I'm using HTML plugin version 1.11 and Jenkins version 2.7.1 [htmlpublisher] Archiving HTML reports... [htmlpublisher] Archiving at PROJECT level C:\Jenkins\workspace\Colleague_API\Colleague_Platform_API to /var/lib/jenkins/jobs/SunilKumar_POC/jobs/Colleague_API/jobs/CP_API_JUNIT_TEST/htmlreports/HTML_Report_${BUILD_NUMBER}

          mcrooney added a comment -

          sillekyatha, I'm not sure that ${BUILD_NUMBER} format is supported, can you try just $BUILD_NUMBER and report back?

          mcrooney added a comment - sillekyatha , I'm not sure that ${BUILD_NUMBER} format is supported, can you try just $BUILD_NUMBER and report back?

          Naresh G added a comment -

          Hi, am getting a similar issue when using the multi configuration job.
          I want to publish set of html files which are created as part of multi config job.
          I am trying to consolidate the files and display them in my jobs.
          What i can do is hard code the file names to get it displayed but what i want to achieve is publish all html files as part the job using a variable.

          Naresh G added a comment - Hi, am getting a similar issue when using the multi configuration job. I want to publish set of html files which are created as part of multi config job. I am trying to consolidate the files and display them in my jobs. What i can do is hard code the file names to get it displayed but what i want to achieve is publish all html files as part the job using a variable.

          Ashok Kumar added a comment -

          I Still can't able to get the environmental variable in the email (HTML)section of the jenkins job

          Ashok Kumar added a comment - I Still can't able to get the environmental variable in the email (HTML)section of the jenkins job

          Ashok Kumar added a comment -

          Still $BUILD_NUMBER is not supported please tell me the changes to be made for this particular concern.

          Ashok Kumar added a comment - Still $BUILD_NUMBER is not supported please tell me the changes to be made for this particular concern.

          Gael BRESSON added a comment - - edited

          ashokkumarvillapuram : use the following to make it works : ${BUILD_NUMBER}
          I just tried and that works fine with the following version : Jenkins : 2.150.1 / HTML Publisher : 1.18

          Gael BRESSON added a comment - - edited ashokkumarvillapuram : use the following to make it works : ${BUILD_NUMBER} I just tried and that works fine with the following version : Jenkins : 2.150.1 / HTML Publisher : 1.18

            mcrooney mcrooney
            yrsone yrsone
            Votes:
            6 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: