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

EnvInject properties not consistently used for SCM

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • envinject-plugin
    • None

      Properties set in the job configuration can be used in the SCM configuration, but they do not appear to be applied to the 'Poll SCM' build trigger.

      In our environment, we specify the Perforce 'Client View Type' as 'View Map from File', and the file name depends on project parameters. When such a build is triggered manually, the parameters are applied. Here is the the first few lines of output from the 'Console Output' for a manual build.

      Started by user Travis Vitek
      [EnvInject] - Loading node environment variables.
      [EnvInject] - Preparing an environment for the build.
      [EnvInject] - Keeping Jenkins system variables.
      [EnvInject] - Keeping Jenkins build variables.
      [EnvInject] - Adding build parameters as variables.
      [EnvInject] - Injecting as environment variables the properties content 
      PROJECT_BRANCH=main
      PROJECT_NAME=tools
      
      [EnvInject] - Variables injected successfully.
      [EnvInject] - Injecting contributions.
      Building remotely on jayhawk in workspace /build/jenkins-slave/workspace/jenkins-test
      
      Deleting project workspace... Read ClientSpec from: //projects/main-tools.clientspec
      [jenkins-test] $ "C:\Program Files\Perforce\p4.exe" print -q //projects/main-tools.clientspec
      

      But when the the 'Poll SCM' build trigger is used, the parameters are not applied. Here is the output of the 'Perforce Polling Log'

      Started on Nov 28, 2012 11:17:51 AM
      Looking for changes...
      Using node: jayhawk
      Read ClientSpec from: //projects/${PROJECT_BRANCH}-${PROJECT_NAME}.clientspec
      [jenkins-slave] $ "C:\Program Files\Perforce\p4.exe" print -q //projects/${PROJECT_BRANCH}-${PROJECT_NAME}.clientspec
      

            gbois Gregory Boissinot
            vitek Travis Vitek
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: