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

Pre-SCM and Post-SCM environment scripts do not use Pre-SCM and Post-SCM properties

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: envinject-plugin
    • Labels:
      None
    • Environment:
      Windows Server 2003 SP2
    • Similar Issues:

      Description

      The Pre-SCM and Post-SCM environment scripts are not able to use any variables set up in the Pre-SCM and Post-SCM properties sections.

      According to the Help in both sections:
      Execute a script file aimed at setting an environment such a create folders, copying files, and so on.
      Give the script file content.
      You can use the above properties variables. <---NOT WORKING
      However, adding or overriding environment variables in the script has no impact in the build job.

      To reproduce (same result in both Pre-SCM section and Post-SCM section):
      1) Create a new job and select configuration
      2) Check "prepare an environment" for the job
      3) In the Properties Content fill in
      --------------------------------------------------------------
      TESTVAR=whereAmI
      --------------------------------------------------------------
      4) In the Environment Script Content fill in:
      ---------------------------------------------------------------
      echo ${TESTVAR}
      echo $TESTVAR
      echo %TESTVAR%
      set
      ---------------------------------------------------------------

      RESULT:
      TESTVAR is not set/resolvable anywhere

      LOG:
      [EnvInject] - Injecting as environment variables the properties content
      'TESTVAR=whereAmI
      '

      [EnvInject] - Executing the script:
      echo ${TESTVAR}
      echo $TESTVAR
      echo %TESTVAR%
      set
      [jenkins] $ cmd /c call C:\WINDOWS\TEMP\hudson3574349175901208979.bat

      D:\jenkins>echo ${TESTVAR}
      ${TESTVAR}

      D:\jenkins>echo $TESTVAR
      $TESTVAR

      D:\jenkins>echo
      ECHO is on.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/org/jenkinsci/plugins/envinject/EnvInjectListener.java
          http://jenkins-ci.org/commit/envinject-plugin/1adeec115c1c960b37ccb7a3c3d9d0c53cf15adb
          Log:
          Fixed JENKINS-11067

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/org/jenkinsci/plugins/envinject/EnvInjectListener.java http://jenkins-ci.org/commit/envinject-plugin/1adeec115c1c960b37ccb7a3c3d9d0c53cf15adb Log: Fixed JENKINS-11067
          Hide
          gbois Gregory Boissinot added a comment -

          I fixed it. The environment variables provided by the content are propagated to the script, unless for the set command that is a special case.

          Show
          gbois Gregory Boissinot added a comment - I fixed it. The environment variables provided by the content are propagated to the script, unless for the set command that is a special case.
          Hide
          gbois Gregory Boissinot added a comment -

          Available in 0.18

          Show
          gbois Gregory Boissinot added a comment - Available in 0.18
          Hide
          pixman20 pixman20 added a comment -

          Thanks for the quick fixes!!!

          Unfortunately I'm not seeing any version later than 0.15 available in the Update Center.
          I tried refreshing and was able to see other plugin updates but not 0.18 for envinject.

          Show
          pixman20 pixman20 added a comment - Thanks for the quick fixes!!! Unfortunately I'm not seeing any version later than 0.15 available in the Update Center. I tried refreshing and was able to see other plugin updates but not 0.18 for envinject.
          Hide
          ericcitaire Eric Citaire added a comment -

          This bug is back again. Reproduced with versions 2.1 and 2.1.5.

          Show
          ericcitaire Eric Citaire added a comment - This bug is back again. Reproduced with versions 2.1 and 2.1.5.

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              pixman20 pixman20
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: