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

EnvInject - prepare environment to run - allow for environment variables in file path names

      I want to be able to supply a file path using environment variables.
      For example, I have a global environment variable called SCRIPTDIR.

      For Properties File Path, use as:
      $SCRIPTDIR\job1-properties

          [JENKINS-18051] EnvInject - prepare environment to run - allow for environment variables in file path names

          This works fine using Jenkins v1.520 and EnvInject v1.85.

          Syntax is:
          "${SCRIPTDIR}\job1-properties"

          Be aware that:

          1) If the file does not exist in the given path, EnvInject does not expand environment variables in the error message and will display something like "[EnvInject] - [ERROR] - The given properties file path '${SCRIPTDIR}\job1-properties' doesn't exist."

          2) EnvInject seems to be sensible to casing of variable names. In your example, configuring the file path to "${scriptdir}\job1-properties" will result in an error (see 1)).

          Geoffroy Jabouley added a comment - This works fine using Jenkins v1.520 and EnvInject v1.85. Syntax is: "${SCRIPTDIR}\job1-properties" Be aware that: 1) If the file does not exist in the given path, EnvInject does not expand environment variables in the error message and will display something like " [EnvInject] - [ERROR] - The given properties file path '${SCRIPTDIR}\job1-properties' doesn't exist." 2) EnvInject seems to be sensible to casing of variable names. In your example, configuring the file path to "${scriptdir}\job1-properties" will result in an error (see 1)).

            gbois Gregory Boissinot
            dreiland Doug Reiland
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: