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
a0e6a98a
Unverified
Commit
a0e6a98a
authored
Oct 23, 2018
by
Jason Song
Committed by
GitHub
Oct 23, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into ldap_support_ad
parents
043ed967
f73ded8c
Changes
25
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
115 additions
and
39 deletions
+115
-39
CONTRIBUTING.md
CONTRIBUTING.md
+12
-0
README.md
README.md
+3
-4
apollo-adminservice/pom.xml
apollo-adminservice/pom.xml
+1
-1
apollo-adminservice/src/main/docker/Dockerfile
apollo-adminservice/src/main/docker/Dockerfile
+1
-1
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/ClusterController.java
...ork/apollo/adminservice/controller/ClusterController.java
+8
-0
apollo-adminservice/src/test/java/com/ctrip/framework/apollo/adminservice/controller/ClusterControllerTest.java
...apollo/adminservice/controller/ClusterControllerTest.java
+48
-0
apollo-assembly/pom.xml
apollo-assembly/pom.xml
+1
-1
apollo-biz/pom.xml
apollo-biz/pom.xml
+1
-1
apollo-buildtools/pom.xml
apollo-buildtools/pom.xml
+1
-1
apollo-client/README.md
apollo-client/README.md
+1
-1
apollo-client/pom.xml
apollo-client/pom.xml
+1
-1
apollo-common/pom.xml
apollo-common/pom.xml
+1
-1
apollo-configservice/pom.xml
apollo-configservice/pom.xml
+1
-1
apollo-configservice/src/main/docker/Dockerfile
apollo-configservice/src/main/docker/Dockerfile
+1
-1
apollo-core/pom.xml
apollo-core/pom.xml
+1
-1
apollo-core/src/main/java/com/ctrip/framework/apollo/core/internals/LegacyMetaServerProvider.java
...ework/apollo/core/internals/LegacyMetaServerProvider.java
+26
-17
apollo-demo/pom.xml
apollo-demo/pom.xml
+1
-1
apollo-mockserver/pom.xml
apollo-mockserver/pom.xml
+1
-1
apollo-openapi/pom.xml
apollo-openapi/pom.xml
+1
-1
apollo-portal/pom.xml
apollo-portal/pom.xml
+1
-1
apollo-portal/src/main/docker/Dockerfile
apollo-portal/src/main/docker/Dockerfile
+1
-1
doc/images/known-users/caibeike.png
doc/images/known-users/caibeike.png
+0
-0
doc/images/known-users/xiaoying.png
doc/images/known-users/xiaoying.png
+0
-0
doc/images/known-users/yeelight.png
doc/images/known-users/yeelight.png
+0
-0
pom.xml
pom.xml
+2
-2
No files found.
CONTRIBUTING.md
View file @
a0e6a98a
...
...
@@ -22,4 +22,16 @@ We provide template files [intellij-java-google-style.xml](https://github.com/ct
*
If no-one else is using your branch, please rebase it against the current master (or other target branch in the main project).
*
Normally, we would squash commits for one feature into one commit. There are 2 ways to do this:
1. To rebase and squash based on the remote branch
* `git rebase -i <remote>/master`
* merge commits via `fixup`, etc
2. Create a new branch and merge these commits into one
* `git checkout -b <some-branch-name> <remote>/master`
* `git merge --squash <current-feature-branch>`
*
When writing a commit message please follow these conventions: if you are fixing an existing issue, please add Fixes #XXX at the end of the commit message (where XXX is the issue number).
README.md
View file @
a0e6a98a
...
...
@@ -24,10 +24,6 @@ Java客户端不依赖任何框架,能够运行于所有Java运行时环境,
本地快速部署请参见
[
Quick Start
](
https://github.com/ctripcorp/apollo/wiki/Quick-Start
)
公益演示环境(Demo):
-
[
140.143.100.23:8070
](
http://140.143.100.23:8070/
)
-
账号/密码:apollo/admin
# Screenshots

...
...
@@ -230,3 +226,6 @@ The project is licensed under the [Apache 2 license](https://github.com/ctripcor






apollo-adminservice/pom.xml
View file @
a0e6a98a
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
1.
1.1
-SNAPSHOT
</version>
<version>
1.
2.0
-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-adminservice/src/main/docker/Dockerfile
View file @
a0e6a98a
...
...
@@ -7,7 +7,7 @@
FROM
openjdk:8-jre-alpine
MAINTAINER
ameizi <sxyx2008@163.com>
ENV
VERSION 1.
1
.0-SNAPSHOT
ENV
VERSION 1.
2
.0-SNAPSHOT
RUN
echo
"http://mirrors.aliyun.com/alpine/v3.8/main"
>
/etc/apk/repositories
\
&&
echo
"http://mirrors.aliyun.com/alpine/v3.8/community"
>>
/etc/apk/repositories
\
...
...
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/ClusterController.java
View file @
a0e6a98a
...
...
@@ -8,6 +8,7 @@ import com.ctrip.framework.apollo.common.exception.NotFoundException;
import
com.ctrip.framework.apollo.common.utils.BeanUtils
;
import
com.ctrip.framework.apollo.common.utils.InputValidator
;
import
com.ctrip.framework.apollo.core.ConfigConsts
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -51,10 +52,17 @@ public class ClusterController {
@RequestMapping
(
path
=
"/apps/{appId}/clusters/{clusterName:.+}"
,
method
=
RequestMethod
.
DELETE
)
public
void
delete
(
@PathVariable
(
"appId"
)
String
appId
,
@PathVariable
(
"clusterName"
)
String
clusterName
,
@RequestParam
String
operator
)
{
Cluster
entity
=
clusterService
.
findOne
(
appId
,
clusterName
);
if
(
entity
==
null
)
{
throw
new
NotFoundException
(
"cluster not found for clusterName "
+
clusterName
);
}
if
(
ConfigConsts
.
CLUSTER_NAME_DEFAULT
.
equals
(
entity
.
getName
())){
throw
new
BadRequestException
(
"can not delete default cluster!"
);
}
clusterService
.
delete
(
entity
.
getId
(),
operator
);
}
...
...
apollo-adminservice/src/test/java/com/ctrip/framework/apollo/adminservice/controller/ClusterControllerTest.java
0 → 100644
View file @
a0e6a98a
package
com
.
ctrip
.
framework
.
apollo
.
adminservice
.
controller
;
import
static
org
.
mockito
.
Matchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
import
static
org
.
mockito
.
Mockito
.
when
;
import
com.ctrip.framework.apollo.biz.entity.Cluster
;
import
com.ctrip.framework.apollo.biz.service.ClusterService
;
import
com.ctrip.framework.apollo.common.exception.BadRequestException
;
import
com.ctrip.framework.apollo.core.ConfigConsts
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.mockito.Mock
;
import
org.mockito.MockitoAnnotations
;
import
org.springframework.test.util.ReflectionTestUtils
;
public
class
ClusterControllerTest
{
private
ClusterController
clusterController
;
@Mock
private
ClusterService
clusterService
;
@Before
public
void
setUp
()
{
clusterController
=
new
ClusterController
();
MockitoAnnotations
.
initMocks
(
this
);
ReflectionTestUtils
.
setField
(
clusterController
,
"clusterService"
,
clusterService
);
}
@Test
(
expected
=
BadRequestException
.
class
)
public
void
testDeleteDefaultFail
()
{
Cluster
cluster
=
new
Cluster
();
cluster
.
setName
(
ConfigConsts
.
CLUSTER_NAME_DEFAULT
);
when
(
clusterService
.
findOne
(
any
(
String
.
class
),
any
(
String
.
class
))).
thenReturn
(
cluster
);
clusterController
.
delete
(
"1"
,
"2"
,
"d"
);
}
@Test
public
void
testDeleteSuccess
()
{
Cluster
cluster
=
new
Cluster
();
when
(
clusterService
.
findOne
(
any
(
String
.
class
),
any
(
String
.
class
))).
thenReturn
(
cluster
);
clusterController
.
delete
(
"1"
,
"2"
,
"d"
);
verify
(
clusterService
,
times
(
1
)).
findOne
(
"1"
,
"2"
);
}
}
apollo-assembly/pom.xml
View file @
a0e6a98a
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
1.
1.1
-SNAPSHOT
</version>
<version>
1.
2.0
-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-biz/pom.xml
View file @
a0e6a98a
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
1.
1.1
-SNAPSHOT
</version>
<version>
1.
2.0
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apollo-biz
</artifactId>
...
...
apollo-buildtools/pom.xml
View file @
a0e6a98a
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
1.
1.1
-SNAPSHOT
</version>
<version>
1.
2.0
-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-client/README.md
View file @
a0e6a98a
...
...
@@ -88,7 +88,7 @@ If you need this functionality, you could specify the cluster as follows:
<dependency>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo-client
</artifactId>
<version>
1.
1.1
-SNAPSHOT
</version>
<version>
1.
2.0
-SNAPSHOT
</version>
</dependency>
## III. Client Usage
...
...
apollo-client/pom.xml
View file @
a0e6a98a
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
1.
1.1
-SNAPSHOT
</version>
<version>
1.
2.0
-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-common/pom.xml
View file @
a0e6a98a
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
1.
1.1
-SNAPSHOT
</version>
<version>
1.
2.0
-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-configservice/pom.xml
View file @
a0e6a98a
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
1.
1.1
-SNAPSHOT
</version>
<version>
1.
2.0
-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-configservice/src/main/docker/Dockerfile
View file @
a0e6a98a
...
...
@@ -7,7 +7,7 @@
FROM
openjdk:8-jre-alpine
MAINTAINER
ameizi <sxyx2008@163.com>
ENV
VERSION 1.
1.1
-SNAPSHOT
ENV
VERSION 1.
2.0
-SNAPSHOT
RUN
echo
"http://mirrors.aliyun.com/alpine/v3.8/main"
>
/etc/apk/repositories
\
&&
echo
"http://mirrors.aliyun.com/alpine/v3.8/community"
>>
/etc/apk/repositories
\
...
...
apollo-core/pom.xml
View file @
a0e6a98a
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
1.
1.1
-SNAPSHOT
</version>
<version>
1.
2.0
-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-core/src/main/java/com/ctrip/framework/apollo/core/internals/LegacyMetaServerProvider.java
View file @
a0e6a98a
package
com
.
ctrip
.
framework
.
apollo
.
core
.
internals
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Properties
;
import
com.ctrip.framework.apollo.core.enums.Env
;
import
com.ctrip.framework.apollo.core.spi.MetaServerProvider
;
import
com.ctrip.framework.apollo.core.utils.ResourceUtils
;
import
com.google.common.base.Strings
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Properties
;
/**
* For legacy meta server configuration use, i.e. apollo-env.properties
*/
public
class
LegacyMetaServerProvider
implements
MetaServerProvider
{
// make it as lowest as possible, yet not the lowest
public
static
final
int
ORDER
=
MetaServerProvider
.
LOWEST_PRECEDENCE
-
1
;
private
static
final
Map
<
Env
,
String
>
domains
=
new
HashMap
<>();
...
...
@@ -23,19 +24,27 @@ public class LegacyMetaServerProvider implements MetaServerProvider {
private
void
initialize
()
{
Properties
prop
=
new
Properties
();
prop
=
ResourceUtils
.
readConfigFile
(
"apollo-env.properties"
,
prop
);
Properties
env
=
System
.
getProperties
();
domains
.
put
(
Env
.
LOCAL
,
env
.
getProperty
(
"local_meta"
,
prop
.
getProperty
(
"local.meta"
)));
domains
.
put
(
Env
.
DEV
,
env
.
getProperty
(
"dev_meta"
,
prop
.
getProperty
(
"dev.meta"
)));
domains
.
put
(
Env
.
FAT
,
env
.
getProperty
(
"fat_meta"
,
prop
.
getProperty
(
"fat.meta"
)));
domains
.
put
(
Env
.
UAT
,
env
.
getProperty
(
"uat_meta"
,
prop
.
getProperty
(
"uat.meta"
)));
domains
.
put
(
Env
.
LPT
,
env
.
getProperty
(
"lpt_meta"
,
prop
.
getProperty
(
"lpt.meta"
)));
domains
.
put
(
Env
.
PRO
,
env
.
getProperty
(
"pro_meta"
,
prop
.
getProperty
(
"pro.meta"
)));
domains
.
put
(
Env
.
LOCAL
,
getMetaServerAddress
(
prop
,
"local_meta"
,
"local.meta"
));
domains
.
put
(
Env
.
DEV
,
getMetaServerAddress
(
prop
,
"dev_meta"
,
"dev.meta"
));
domains
.
put
(
Env
.
FAT
,
getMetaServerAddress
(
prop
,
"fat_meta"
,
"fat.meta"
));
domains
.
put
(
Env
.
UAT
,
getMetaServerAddress
(
prop
,
"uat_meta"
,
"uat.meta"
));
domains
.
put
(
Env
.
LPT
,
getMetaServerAddress
(
prop
,
"lpt_meta"
,
"lpt.meta"
));
domains
.
put
(
Env
.
PRO
,
getMetaServerAddress
(
prop
,
"pro_meta"
,
"pro.meta"
));
}
private
String
getMetaServerAddress
(
Properties
prop
,
String
sourceName
,
String
propName
)
{
// 1. Get from System Property.
String
metaAddress
=
System
.
getProperty
(
sourceName
);
if
(
Strings
.
isNullOrEmpty
(
metaAddress
))
{
// 2. Get from OS environment variable, which could not contain dot and is normally in UPPER case,like DEV_META.
metaAddress
=
System
.
getenv
(
sourceName
.
toUpperCase
());
}
if
(
Strings
.
isNullOrEmpty
(
metaAddress
))
{
// 3. Get from properties file.
metaAddress
=
prop
.
getProperty
(
propName
);
}
return
metaAddress
;
}
@Override
...
...
apollo-demo/pom.xml
View file @
a0e6a98a
...
...
@@ -4,7 +4,7 @@
<parent>
<artifactId>
apollo
</artifactId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<version>
1.
1.1
-SNAPSHOT
</version>
<version>
1.
2.0
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apollo-demo
</artifactId>
...
...
apollo-mockserver/pom.xml
View file @
a0e6a98a
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
apollo
</artifactId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<version>
1.
1.1
-SNAPSHOT
</version>
<version>
1.
2.0
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-openapi/pom.xml
View file @
a0e6a98a
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
apollo
</artifactId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<version>
1.
1.1
-SNAPSHOT
</version>
<version>
1.
2.0
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-portal/pom.xml
View file @
a0e6a98a
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
1.
1.1
-SNAPSHOT
</version>
<version>
1.
2.0
-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-portal/src/main/docker/Dockerfile
View file @
a0e6a98a
...
...
@@ -7,7 +7,7 @@
FROM
openjdk:8-jre-alpine
MAINTAINER
ameizi <sxyx2008@163.com>
ENV
VERSION 1.
1.1-SNAPSHOT0
ENV
VERSION 1.
2.0-SNAPSHOT
RUN
echo
"http://mirrors.aliyun.com/alpine/v3.8/main"
>
/etc/apk/repositories
\
&&
echo
"http://mirrors.aliyun.com/alpine/v3.8/community"
>>
/etc/apk/repositories
\
...
...
doc/images/known-users/caibeike.png
0 → 100644
View file @
a0e6a98a
10.5 KB
doc/images/known-users/xiaoying.png
0 → 100644
View file @
a0e6a98a
7.95 KB
doc/images/known-users/yeelight.png
0 → 100644
View file @
a0e6a98a
8.56 KB
pom.xml
View file @
a0e6a98a
...
...
@@ -5,7 +5,7 @@
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
1.
1.1
-SNAPSHOT
</version>
<version>
1.
2.0
-SNAPSHOT
</version>
<name>
Apollo
</name>
<packaging>
pom
</packaging>
<description>
Ctrip Configuration Center
</description>
...
...
@@ -434,7 +434,7 @@
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<version>
1.3.
8
.RELEASE
</version>
<version>
1.3.
5
.RELEASE
</version>
<executions>
<execution>
<goals>
...
...
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