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

Properties not injected and build marked as failed

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Component/s: envinject-plugin
    • Labels:
      None
    • Environment:
      os.name Linux
      os.arch amd64
      os.version 2.6.18-128.1.10.el5xen

      Jenkins 1.426
      EnvInject 0.11
    • Similar Issues:

      Description

      On slaves EnvInject does not inject properties from a file and markes the build FAILED without printing a reason to the console.
      The properties file to read Environment Variables from needs to come from SVN.

      I tried the following on a test job (a matrix configuration configured for master and slave nodes, I also tried it on a parameterized freestyle job, with same results):

      Build Environment > Inject environment variables to the build process > Properties File Path=src/test.properties
      (also tried it with $

      {WORKSPACE}/src/meta.properties with same result)

      This prints:
      [EnvInject] - Injecting as environment variables the properties file path 'src/test.properties'
      to the console output


      Next, as an Execute shell Buildstep I do:
      echo xxx=${propertySetIn_test.properties_}
      echo WORKSPACE=${WORKSPACE}

      ls -al $

      {WORKSPACE}

      /src/test.properties

      This prints 'xxx=' to the console output, the correct workspace on the slave, and proves that the file exists.

      Then, in a second Buildstep of type 'Inject environment variables' I then try to insert from the same file, followed by the same tests.

      This prints
      [EnvInject] - Injecting as environment variables the properties file path '/path/to/my/workspace/test_envinject_Matrix/label/slave1/src/test.properties'
      Build step 'Inject environment variables' changed build result to FAILURE
      Build step 'Inject environment variables' marked build as failure
      Finished: FAILURE

      Further remarks:
      On the master the first pass (in the Build Environment section) does not seem to result in properties being inserted, as they cannot be echoed. After the second pass (injecting as a Build Step) the properties are set on the master, as they can be echoed.
      These results seem unaffected by setting 'Prepare an environmetn for the job (with both Keep options enabled) and the System Configuration 'Prepare jobs environment > Unset System Environment Variables' settings.

        Attachments

          Activity

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              josbraaksma Jos Braaksma
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: