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

Unusable environment variable TRIGGERED_BUILD_NUMBER_jobname

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The plugin exports two environment variables named TRIGGERED_BUILD_NUMBER_<jobname>=<buildnumber>. However, if your job has characters outside the alphanumeric range, the variable exported is unusable. Example: my job is named project-builder, then the exported variable will be TRIGGERED_BUILD_NUMBER_project-builder=123. Because of the - character, this variable is unusable. ${TRIGGERED_BUILD_NUMBER_project-builder} does not work.

      The copy artifact plugin does a sanitation of the project name in the same export like this for it's COPYARTIFACT_BUILD_NUMBER_jobname environment var:

      projectName.toUpperCase().replaceAll("[^A-Z]+", "_")
      

      I think the the regex can be extended with 0-9 as valid characters too actually, but this would be the fix for this problem too.

        Attachments

          Issue Links

            Activity

            Hide
            hiteswar_kumar hiteswar kumar added a comment -

            any status for fixing this issue!!!

            Show
            hiteswar_kumar hiteswar kumar added a comment - any status for fixing this issue!!!
            Hide
            cjo9900 cjo9900 added a comment -
            Show
            cjo9900 cjo9900 added a comment - Pull request for this fix https://github.com/jenkinsci/parameterized-trigger-plugin/pull/27
            Hide
            hiteswar_kumar hiteswar kumar added a comment -

            Can you please consider this fix in coming release of this plugin.
            and can you please share next release schedule and bug fixes included?

            Show
            hiteswar_kumar hiteswar kumar added a comment - Can you please consider this fix in coming release of this plugin. and can you please share next release schedule and bug fixes included?
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: cjo9900
            Path:
            src/main/java/hudson/plugins/parameterizedtrigger/BuildInfoExporterAction.java
            src/main/resources/hudson/plugins/parameterizedtrigger/BlockableBuildTriggerConfig/help-block.html
            http://jenkins-ci.org/commit/parameterized-trigger-plugin/2a276922f90844924b1a32fd1fec7133e1db9311
            Log:
            [FIXED JENKINS-14545] Correct Env variables

            Extend and correct Enviroment variables that are provided when
            using block until other projects are completed, in the trigger/call
            other projects buildstep.

            Extended vaiables to provide the full list of projects triggered, and
            the full list of builds triggered when using the parameter factories.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: cjo9900 Path: src/main/java/hudson/plugins/parameterizedtrigger/BuildInfoExporterAction.java src/main/resources/hudson/plugins/parameterizedtrigger/BlockableBuildTriggerConfig/help-block.html http://jenkins-ci.org/commit/parameterized-trigger-plugin/2a276922f90844924b1a32fd1fec7133e1db9311 Log: [FIXED JENKINS-14545] Correct Env variables Extend and correct Enviroment variables that are provided when using block until other projects are completed, in the trigger/call other projects buildstep. Extended vaiables to provide the full list of projects triggered, and the full list of builds triggered when using the parameter factories.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: cjo9900
            Path:
            src/main/java/hudson/plugins/parameterizedtrigger/BuildInfoExporterAction.java
            src/main/resources/hudson/plugins/parameterizedtrigger/BlockableBuildTriggerConfig/help-block.html
            src/test/java/hudson/plugins/parameterizedtrigger/test/BuildInfoExporterTest.java
            http://jenkins-ci.org/commit/parameterized-trigger-plugin/ac43521d48e99eb0f441e9e89d810771791267fd
            Log:
            [FIXED JENKINS-14545] Correct and add testcases for Env variables

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: cjo9900 Path: src/main/java/hudson/plugins/parameterizedtrigger/BuildInfoExporterAction.java src/main/resources/hudson/plugins/parameterizedtrigger/BlockableBuildTriggerConfig/help-block.html src/test/java/hudson/plugins/parameterizedtrigger/test/BuildInfoExporterTest.java http://jenkins-ci.org/commit/parameterized-trigger-plugin/ac43521d48e99eb0f441e9e89d810771791267fd Log: [FIXED JENKINS-14545] Correct and add testcases for Env variables
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: cjo9900
            Path:
            src/main/java/hudson/plugins/parameterizedtrigger/BuildInfoExporterAction.java
            src/main/resources/hudson/plugins/parameterizedtrigger/BlockableBuildTriggerConfig/help-block.html
            src/test/java/hudson/plugins/parameterizedtrigger/test/BuildInfoExporterTest.java
            http://jenkins-ci.org/commit/parameterized-trigger-plugin/fae74afa6b3f88ce184635079f766ee5ba91e2d7
            Log:
            Merge branch 'JENKINS-14545' of git://github.com/cjo9900/parameterized-trigger-plugin into 2.17-RC

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: cjo9900 Path: src/main/java/hudson/plugins/parameterizedtrigger/BuildInfoExporterAction.java src/main/resources/hudson/plugins/parameterizedtrigger/BlockableBuildTriggerConfig/help-block.html src/test/java/hudson/plugins/parameterizedtrigger/test/BuildInfoExporterTest.java http://jenkins-ci.org/commit/parameterized-trigger-plugin/fae74afa6b3f88ce184635079f766ee5ba91e2d7 Log: Merge branch ' JENKINS-14545 ' of git://github.com/cjo9900/parameterized-trigger-plugin into 2.17-RC
            Hide
            wgc123 D Pasto added a comment - - edited

            I see this is ancient at this point so i won't re-open, but the fix appears to have caused JENKINS-34340 .  We need a more targetted fix for this

            Show
            wgc123 D Pasto added a comment - - edited I see this is ancient at this point so i won't re-open, but the fix appears to have caused JENKINS-34340  .  We need a more targetted fix for this

              People

              • Assignee:
                cjo9900 cjo9900
                Reporter:
                john John van der Kamp
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: