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

provide access to arbitrary environment variables

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: email-ext-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      It would be useful to be able to access other environemnt variables, apart from
      the predefined ones. The user should be able to set such variables in a build
      step, and then access them as tokens in the e-mail template.

        Attachments

          Activity

          Hide
          mindless Alan Harder added a comment -

          Implemented in r15326 by againjj.
          Included in email-ext 2.3, released today.

          Show
          mindless Alan Harder added a comment - Implemented in r15326 by againjj. Included in email-ext 2.3, released today.
          Hide
          rajpra rajpra added a comment - - edited

          I found a issues with this fix.

          the environment variables displayed are system ones only. So if part of the build script you set a environment variable which you want show in the email, you cant.
          eg.
          If in Linux build script i add.

          export COPY_PATH=/var/app/$BUILD_TAG/

          In the Hudson email config I would like to say:

          Build has been copied to ${ENV, COPY_PATH}
          But when i do this, nothing is displayed.

          Show
          rajpra rajpra added a comment - - edited I found a issues with this fix. the environment variables displayed are system ones only. So if part of the build script you set a environment variable which you want show in the email, you cant. eg. If in Linux build script i add. export COPY_PATH=/var/app/$BUILD_TAG/ In the Hudson email config I would like to say: Build has been copied to ${ENV, COPY_PATH} But when i do this, nothing is displayed.
          Hide
          rajpra rajpra added a comment -

          same type of issue

          Show
          rajpra rajpra added a comment - same type of issue
          Hide
          rajpra rajpra added a comment -

          related.

          Show
          rajpra rajpra added a comment - related.
          Hide
          mdonohue mdonohue added a comment -

          That is not the way environment variables work. When you set an environment variable in a child shell, it is not accessible by the parent. You need to have the copy path set as a Hudson parameter.

          Show
          mdonohue mdonohue added a comment - That is not the way environment variables work. When you set an environment variable in a child shell, it is not accessible by the parent. You need to have the copy path set as a Hudson parameter.
          Hide
          dcoraboe dcoraboe added a comment -

          This case happens also for some parameterised builds.

          Our build is parameterised by a SOURCE_BUILD_NUMBER variable.

          The mail contains the reference ${ENV,SOURCE_BUILD_NUMBER} as indicated in the help, but this value is not replaced.

          Show
          dcoraboe dcoraboe added a comment - This case happens also for some parameterised builds. Our build is parameterised by a SOURCE_BUILD_NUMBER variable. The mail contains the reference ${ENV,SOURCE_BUILD_NUMBER} as indicated in the help, but this value is not replaced.
          Hide
          mindless Alan Harder added a comment -

          reclosing.. export from subshell is invalid, as mentioned, and getting values from parameters is tracked in a separate issue: JENKINS-7075

          Show
          mindless Alan Harder added a comment - reclosing.. export from subshell is invalid, as mentioned, and getting values from parameters is tracked in a separate issue: JENKINS-7075

            People

            • Assignee:
              againjj againjj
              Reporter:
              mbetter Marcus Better
            • Votes:
              3 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: