Skip to content
Permalink
Browse files

Fix JENKINS-12691

  • Loading branch information...
gboissinot committed Feb 9, 2012
1 parent 818234c commit 83da03b83af3e0dbf96a5d0a6054e105f408da86
@@ -24,7 +24,7 @@
* @return a map containing all the file properties content
* @throws EnvInjectException
*/
public Map<String, String> getVarsFromPropertiesFile(File propertiesFile) throws EnvInjectException {
public Map<String, String> getVarsFromPropertiesFile(File propertiesFile, Map<String, String> currentEnvVars) throws EnvInjectException {

if (propertiesFile == null) {
throw new NullPointerException("The properties file object must be set.");
@@ -39,7 +39,8 @@
try {
String fileContent = Util.loadFile(propertiesFile);
fileContent = processWindowsFilePath(fileContent);
properties.load(new StringReader(fileContent));
String fileContentResolved = Util.replaceMacro(fileContent, currentEnvVars);
properties.load(new StringReader(fileContentResolved));
} catch (IOException ioe) {
throw new EnvInjectException("Problem occurs on loading content", ioe);
}
@@ -49,7 +49,7 @@ public PropertiesVariablesRetriever(String propertiesFilePath, String properties
throw new EnvInjectException(message);
}
logger.info(String.format("Injecting as environment variables the properties file path '%s'", propertiesFilePathResolved));
result.putAll(loader.getVarsFromPropertiesFile(propertiesFile));
result.putAll(loader.getVarsFromPropertiesFile(propertiesFile, currentEnvVars));
logger.info("Variables injected successfully.");
}

0 comments on commit 83da03b

Please sign in to comment.
You can’t perform that action at this time.