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

environment variables for release plugin are not affecting prebuild step!

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • release-plugin
    • None

      We have environment variables set up at the beginning at "Prepare an environment for the run" and used through the entire build.
      We need to modify some of them in case of release run. We set the new values by using Inject environment variable at "Before release build".
      Override build parameters is checked.
      We need updated values before and during SCM runs, which is a prebuild step, but it not happened. The original values are used before and during SCM runs, and new values are injected only at build step.

      What is really strange that release parameters are available at prebuild steps, as expected!
      See the fragment of the build log below. INTEGRITY_PROJECT variable is holding path to the branch of the project in SCM repository. There is a default value for the standard, not release build. For release run, it should be modified based on the release parameter DEVELOPMENT_PATH.
      It became properly modified but not at prebuild step, where it is used, but only at build step, which is too late!

      [EnvInject] - Loading node environment variables.
      [EnvInject] - Preparing an environment for the build.
      [EnvInject] - Keeping Jenkins system variables.
      [EnvInject] - Keeping Jenkins build variables.
      [EnvInject] - Injecting as environment variables the properties content
      INTEGRITY_PROJECT=/repository/CorporateMeasurementTechnologies/SWProduction/TestPlans/TestplanModule/Joule_4140_Module_Test_Frozen/project.pj

      [EnvInject] - Variables injected successfully.
      [EnvInject] - Injecting contributions.
      Building in workspace D:\Jenkins_ROOT\NGMP.Testplan.Joule.4140.Module.Frozen
      Running Prebuild steps
      [NGMP.Testplan.Joule.4140.Module.Frozen] $ cmd /c call C:\Windows\TEMP\hudson5103745806814541490.bat

      D:\Jenkins_ROOT\NGMP.Testplan.Joule.4140.Module.Frozen>REM ---Before SCM runs

      D:\Jenkins_ROOT\NGMP.Testplan.Joule.4140.Module.Frozen>REM @echo DEVELOPMENT_PATH=Rev_13_Bug_Fix

      DEVELOPMENT_PATH=Rev_13_Bug_Fix
      INTEGRITY_PROJECT=/repository/CorporateMeasurementTechnologies/SWProduction/TestPlans/TestplanModule/Joule_4140_Module_Test_Frozen/project.pj

      D:\Jenkins_ROOT\NGMP.Testplan.Joule.4140.Module.Frozen>exit 0
      Success build forhudson.tasks.BatchFile@17f5bbc
      Change Log: http://ds-jenk2-1.biotronik.com:8080/job/NGMP-Testplan.Joule-4140-Module-Test-Frozen/16/changes
      Build Log: http://ds-jenk2-1.biotronik.com:8080/job/NGMP-Testplan.Joule-4140-Module-Test-Frozen/16/console
      Preparing to execute si projectinfo for /repository/CorporateMeasurementTechnologies/SWProduction/TestPlans/TestplanModule/Joule_4140_Module_Test_Frozen/project.pj
      Preparing to execute si viewproject for #/repository/CorporateMeasurementTechnologies#s=SWProduction/SWProduction.pj#s=TestPlans/TestPlans.pj#TestplanModule/Joule_4140_Module_Test_Frozen
      Checkout directory is D:\Jenkins_ROOT\NGMP.Testplan.Joule.4140.Module.Frozen\Sandbox\SWProduction\Testplans\TestplanModule\Joule_4140_Module_Test_Frozen
      A clean copy is requested; deleting contents of D:\Jenkins_ROOT\NGMP.Testplan.Joule.4140.Module.Frozen\Sandbox\SWProduction\Testplans\TestplanModule\Joule_4140_Module_Test_Frozen
      Populating clean workspace...

      Successfully checked out 119 files!

      Saving current Integrity Project configuration...
      Writing build change log...
      Change log successfully generated: D:\Program Files (x86)\Jenkins\jobs\NGMP-Testplan.Joule-4140-Module-Test-Frozen\builds\2014-07-24_10-42-03\changelog.xml
      [EnvInject] - Injecting environment variables from a build step.
      [EnvInject] - Injecting as environment variables the properties content
      INTEGRITY_PROJECT=#/repository/CorporateMeasurementTechnologies#s=SWProduction/SWProduction.pj#s=TestPlans/TestPlans.pj#TestplanModule/Joule_4140_Module_Test_Frozen#d=Rev_13_Bug_Fix

            petehayes Peter Hayes
            gremlm Grigoriy Milman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: