Gabriele Giuseppini created JENKINS-14006: ---------------------------------------------
Summary: EnvInject stopped resolving environment variables in environment variables Key: JENKINS-14006 URL: https://issues.jenkins-ci.org/browse/JENKINS-14006 Project: Jenkins Issue Type: Bug Components: envinject Environment: Jenkins 1.463, EnvInject 1.54 or 1.50 Reporter: Gabriele Giuseppini Assignee: Gregory Boissinot This looks like an exact regression to JENKINS-13183. We have a Promotion job that injects an env var whose value contains references to other env vars, read from a properties file: {code:xml} <buildSteps> <EnvInjectBuilder> <info> <propertiesFilePath>StageCraft.properties</propertiesFilePath> <propertiesContent>ReleaseDir=${ReleaseRoot}\${PROJECT_NAME}\${PROJECT_NAME}_${PROJECT_SHORT_VERSION} ReleaseDirTest=${env['PROJECT_SHORT_VERSION']} </propertiesContent> </info> </EnvInjectBuilder> {code} (note we added a 'ReleaseDirTest' env var to also try the alternate env var reference syntax). EnvInject used to be fine with this, but after we did a few upgrades (to Jenkins itself and to the EnvInject plugin), it stopped working. Here's the output, together with a dump of the env vars injected in the build steps for diagnostics purposes: {code} Promoting ANONYMIZED #6 [EnvInject] - Injecting environment variables from a build step. [EnvInject] - Injecting as environment variables the properties file path 'StageCraft.properties' [EnvInject] - Variables injected successfully. [EnvInject] - Injecting as environment variables the properties content ReleaseDir=${ReleaseRoot}\${PROJECT_NAME}\${PROJECT_NAME}_${PROJECT_SHORT_VERSION} ReleaseDirTest=${env['PROJECT_SHORT_VERSION']} [EnvInject] - Variables injected successfully. [EnvInject] - Unset unresolved 'ReleaseDir' variable. [EnvInject] - Unset unresolved 'ReleaseDirTest' variable. build org.jenkinsci.plugins.envinject.EnvInjectBuilder@53c01def SUCCESS [workspace] $ cmd /c call C:\Users\svc_ci\AppData\Local\Temp\hudson1186946183352599382.bat C:\jenkins\jobs\ANONYMIZED\workspace>SET ALLUSERSPROFILE=C:\ProgramData ... ProgramW6432=C:\Program Files PROJECT_FULL_VERSION=1.6.0.7 PROJECT_NAME=ANONYMIZED PROJECT_SHORT_VERSION=1.6.0 PROMOTED_ID=2012-06-01_15-42-27 ... C:\jenkins\jobs\Cupid_1.6.x\workspace>exit 0 {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira