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

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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.

            Assignee:
            Gregory Boissinot
            Reporter:
            pixman20
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: