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

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

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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

        Attachments

          Activity

          Hide
          geoffroyjabouley 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)).

          Show
          geoffroyjabouley 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)).

            People

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

              Dates

              Created:
              Updated: