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

EnvInject Plugin - Does not override environment variables at job level

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The EnvInject plugin still does not override the global environment variable in within a jenkins job. I am using version 1.89.

      I have set couple of global variables in the jenkins. In one of the jenkins job, I am trying to override the values of those variables based on a condition. But it is not working.

      Below snippet is for reference:EnvInject - Loading node environment variables.
      EnvInject - Preparing an environment for the build.
      EnvInject - Keeping Jenkins build variables.
      EnvInject - Executing and processing the following script content: This piece is executed in the Prepare an environment for the run section.

      if [ ${EmergencyFix}= true ]

      then
      export RelPractice=${OldRelease}.x; export SprintCycle=""

      fi

      echo ${RelPractice}
      hudson $ /bin/sh -xe /tmp/hudson3221881724786897823.sh
      + '' true = true ''
      + export RelPractice=1.4.x
      + RelPractice=1.4.x
      + export SprintCycle=
      + SprintCycle=
      + echo 1.4.x
      1.4.x
      EnvInject - Script executed successfully.
      EnvInject - Injecting contributions.
      Building on master in workspace /var/lib/hudson/jobs/TestJob_Practice/workspace
      EnvInject - Executing scripts and injecting environment variables after the SCM step.
      EnvInject - Executing and processing the following script content: - This piece is executed in the Build environment section.

      echo ${RelPractice}
      workspace $ /bin/sh -xe /tmp/hudson1726775335392935354.sh
      + echo 1.5
      1.5 - it is showing the old value.
      EnvInject - Script executed successfully.
      Finished: SUCCESS

        Attachments

          Issue Links

            Activity

            There are no comments yet on this issue.

              People

              Assignee:
              gbois Gregory Boissinot
              Reporter:
              prithula Prithula Mukherjee
              Votes:
              4 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: