Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
apollo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
apollo
Commits
1668fa13
Commit
1668fa13
authored
Mar 24, 2019
by
Jared Tan
Committed by
Jason Song
Mar 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add APP_ID env. (#2067)
support setting app id from OS environment variable APP_ID
parent
553d7814
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
apollo-core/src/main/java/com/ctrip/framework/foundation/internals/provider/DefaultApplicationProvider.java
...dation/internals/provider/DefaultApplicationProvider.java
+9
-1
No files found.
apollo-core/src/main/java/com/ctrip/framework/foundation/internals/provider/DefaultApplicationProvider.java
View file @
1668fa13
...
@@ -86,7 +86,15 @@ public class DefaultApplicationProvider implements ApplicationProvider {
...
@@ -86,7 +86,15 @@ public class DefaultApplicationProvider implements ApplicationProvider {
return
;
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"
);
m_appId
=
m_appProperties
.
getProperty
(
"app.id"
);
if
(!
Utils
.
isBlank
(
m_appId
))
{
if
(!
Utils
.
isBlank
(
m_appId
))
{
m_appId
=
m_appId
.
trim
();
m_appId
=
m_appId
.
trim
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment