Skip to content

Commit

Permalink
add APP_ID env. (apolloconfig#2067)
Browse files Browse the repository at this point in the history
support setting app id from OS environment variable APP_ID
  • Loading branch information
JaredTan95 authored and nobodyiam committed Mar 24, 2019
1 parent 553d781 commit 1668fa1
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,15 @@ private void initAppId() {
return;
}

// 2. Try to get app id from app.properties.
//2. Try to get app id from OS environment variable
m_appId = System.getenv("APP_ID");
if (!Utils.isBlank(m_appId)) {
m_appId = m_appId.trim();
logger.info("App ID is set to {} by APP_ID property from OS environment variable", m_appId);
return;
}

// 3. Try to get app id from app.properties.
m_appId = m_appProperties.getProperty("app.id");
if (!Utils.isBlank(m_appId)) {
m_appId = m_appId.trim();
Expand Down

0 comments on commit 1668fa1

Please sign in to comment.