actually get configuration from env *facepalm*
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
85d16ebfc7
commit
3edcc4e09d
@ -2,6 +2,7 @@ package de.devloop.mavor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Properties;
|
||||
|
||||
@ -41,17 +42,30 @@ public class Configuration {
|
||||
developmentProperties.load(developmentPropertiesStream);
|
||||
initByProperties(developmentProperties);
|
||||
} else {
|
||||
initByProperties(System.getProperties());
|
||||
initByMap(System.getenv());
|
||||
}
|
||||
}
|
||||
|
||||
private void initByMap(Map<String, String> map) {
|
||||
webRoot = Objects.requireNonNull(map.get(ENV_WEB_ROOT));
|
||||
mavenExecutable = Objects.requireNonNull(map.get(ENV_MAVEN_EXECUTABLE));
|
||||
tempDir = Objects.requireNonNull(map.get(ENV_TEMP_DIR));
|
||||
openIdClientId = Objects.requireNonNull(map.get(ENV_OPENID_CLIENT_ID));
|
||||
openIdClientSecret = Objects.requireNonNull(map.get(ENV_OPENID_CLIENT_SECRET));
|
||||
openIdRedirectUrl = Objects.requireNonNull(map.get(ENV_OPENID_REDIRECT_URL));
|
||||
openIdAuthUrl = Objects.requireNonNull(map.get(ENV_OPENID_AUTH_URL));
|
||||
openIdTokenUrl = Objects.requireNonNull(map.get(ENV_OPENID_TOKEN_URL));
|
||||
openIdUserInfoUrl = Objects.requireNonNull(map.get(ENV_OPENID_USERINFO_URL));
|
||||
openIdLogoutUrl = Objects.requireNonNull(map.get(ENV_OPENID_LOGOUT_URL));
|
||||
}
|
||||
|
||||
private void initByProperties(Properties properties) {
|
||||
webRoot = getNullSafeProperty(properties, ENV_WEB_ROOT);
|
||||
mavenExecutable = getNullSafeProperty(properties, ENV_MAVEN_EXECUTABLE);
|
||||
tempDir = getNullSafeProperty(properties, ENV_TEMP_DIR);
|
||||
openIdClientId = getNullSafeProperty(properties, ENV_OPENID_CLIENT_ID);
|
||||
openIdClientSecret = getNullSafeProperty(properties, ENV_OPENID_CLIENT_SECRET);
|
||||
openIdRedirectUrl = getNullSafeProperty((properties), ENV_OPENID_REDIRECT_URL);
|
||||
openIdRedirectUrl = getNullSafeProperty(properties, ENV_OPENID_REDIRECT_URL);
|
||||
openIdAuthUrl = getNullSafeProperty(properties, ENV_OPENID_AUTH_URL);
|
||||
openIdTokenUrl = getNullSafeProperty(properties, ENV_OPENID_TOKEN_URL);
|
||||
openIdUserInfoUrl = getNullSafeProperty(properties, ENV_OPENID_USERINFO_URL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user