Skip to content

Commit

Permalink
Get build info property key from env vars only
Browse files Browse the repository at this point in the history
  • Loading branch information
Or-Geva committed Dec 13, 2023
1 parent 17ba691 commit 9ee0176
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,17 +273,8 @@ private static String getPropertiesFileEncryption(Properties additionalProps, St
if (StringUtils.isNotBlank(System.getProperty(key))) {
return System.getProperty(key);
}
if (additionalProps != null) {
// Check for the encryption key directly in additional properties
if (StringUtils.isNotBlank(additionalProps.getProperty(key))) {
return additionalProps.getProperty(key);
}
// Jenkins prefixes these variables with "env." so let's try that
if (StringUtils.isNotBlank(additionalProps.getProperty("env." + key))) {
return additionalProps.getProperty("env." + key);
}
}
return null;
// Check if the encryption key is set in env vars
return System.getenv(key);
}

private static String getAdditionalPropertiesFile(Properties additionalProps, Log log) {
Expand Down

0 comments on commit 9ee0176

Please sign in to comment.