Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
openSource
apollo
Commits
eda9fd7d
Commit
eda9fd7d
authored
Jun 24, 2016
by
Jason Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support system property as server config
parent
99a2cf04
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
20 deletions
+8
-20
ApolloApplication.java
...om/ctrip/framework/apollo/assembly/ApolloApplication.java
+0
-11
PortalApplication.java
.../com/ctrip/framework/apollo/portal/PortalApplication.java
+0
-1
PortalSettings.java
...ava/com/ctrip/framework/apollo/portal/PortalSettings.java
+0
-1
ServerConfigService.java
.../framework/apollo/portal/service/ServerConfigService.java
+8
-0
portal.properties
apollo-portal/src/main/resources/portal.properties
+0
-7
No files found.
apollo-assembly/src/main/java/com/ctrip/framework/apollo/assembly/ApolloApplication.java
View file @
eda9fd7d
...
...
@@ -48,17 +48,6 @@ public class ApolloApplication {
.
sources
(
RefreshScope
.
class
).
run
(
args
);
logger
.
info
(
adminContext
.
getId
()
+
" isActive: "
+
adminContext
.
isActive
());
}
/**
* Portal
*
* WARNING: Do not start portal at the same pool as configservice, they will conflict on 8080
*/
if
(
commonContext
.
getEnvironment
().
containsProperty
(
"portal"
))
{
ConfigurableApplicationContext
portalContext
=
new
SpringApplicationBuilder
(
PortalApplication
.
class
).
parent
(
commonContext
).
run
(
args
);
logger
.
info
(
portalContext
.
getId
()
+
" isActive: "
+
portalContext
.
isActive
());
}
}
}
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/PortalApplication.java
View file @
eda9fd7d
...
...
@@ -17,7 +17,6 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@Configuration
@EnableAutoConfiguration
@EnableTransactionManagement
@PropertySource
(
value
=
{
"classpath:portal.properties"
})
@ComponentScan
(
basePackageClasses
=
{
ApolloCommonConfig
.
class
,
PortalApplication
.
class
})
public
class
PortalApplication
{
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/PortalSettings.java
View file @
eda9fd7d
...
...
@@ -35,7 +35,6 @@ public class PortalSettings {
private
static
final
int
HEALTH_CHECK_INTERVAL
=
5000
;
@Value
(
"#{'${apollo.portal.envs}'.split(',')}"
)
private
List
<
String
>
allStrEnvs
;
@Autowired
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ServerConfigService.java
View file @
eda9fd7d
...
...
@@ -4,6 +4,7 @@ import com.ctrip.framework.apollo.portal.entity.po.ServerConfig;
import
com.ctrip.framework.apollo.portal.repository.ServerConfigRepository
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.env.Environment
;
import
org.springframework.stereotype.Service
;
/**
...
...
@@ -14,7 +15,14 @@ public class ServerConfigService {
@Autowired
private
ServerConfigRepository
serverConfigRepository
;
@Autowired
private
Environment
environment
;
public
String
getValue
(
String
key
)
{
if
(
environment
.
containsProperty
(
key
))
{
return
environment
.
getProperty
(
key
);
}
ServerConfig
serverConfig
=
serverConfigRepository
.
findByKey
(
key
);
return
serverConfig
==
null
?
null
:
serverConfig
.
getValue
();
...
...
apollo-portal/src/main/resources/portal.properties
deleted
100644 → 0
View file @
99a2cf04
spring.application.name
=
apollo-portal
apollo.portal.envs
=
fat,uat,pro
ctrip.appid
=
100003173
server.port
=
8070
logging.file
=
/opt/logs/100003173/apollo-portal.log
server.context_parameters.appid
=
${ctrip.appid}
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