-
-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #494 from pascalgrimaud/spring-cloud-consul-config
Spring Cloud Consul: add central config
- Loading branch information
Showing
6 changed files
with
63 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...ces/generator/server/springboot/springcloud/consul/docker/application.config.yml.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Common configuration shared between all applications | ||
# This file is in format yaml as it is loaded by https://github.com/jhipster/consul-config-loader | ||
configserver: | ||
name: Docker Consul Service | ||
status: Connected to Consul Server running in Docker | ||
|
||
jhipster: | ||
security: | ||
authentication: | ||
jwt: | ||
# secret key which should be base64 encoded and changed in production | ||
base64-secret: {{{base64JwtSecret}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,22 @@ | |
#==================================================================== | ||
|
||
spring.application.name={{baseName}} | ||
|
||
spring.cloud.consul.host=localhost | ||
spring.cloud.consul.port=8500 | ||
|
||
spring.cloud.consul.config.format=yaml | ||
spring.cloud.consul.config.profile-separator=- | ||
spring.cloud.consul.config.watch.enabled=false | ||
|
||
spring.cloud.consul.discovery.health-check-path=/management/health | ||
spring.cloud.consul.discovery.tags[0][email protected]@ | ||
spring.cloud.consul.discovery.tags[1]=context-path=${server.servlet.context-path:} | ||
spring.cloud.consul.host=localhost | ||
spring.cloud.consul.port=8500 | ||
spring.cloud.consul.discovery.tags[2]=profile=${spring.profiles.active:} | ||
spring.cloud.consul.discovery.tags[3]=git-version=${git.commit.id.describe:} | ||
spring.cloud.consul.discovery.tags[4]=git-commit=${git.commit.id.abbrev:} | ||
spring.cloud.consul.discovery.tags[5]=git-branch=${git.branch:} | ||
|
||
spring.cloud.consul.discovery.instance-id={{baseName}}:${spring.application.instance-id:${random.value}} | ||
spring.cloud.consul.discovery.service-name={{baseName}} | ||
spring.cloud.consul.discovery.prefer-ip-address=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,8 +73,10 @@ public static void assertProperties(Project project) { | |
"spring.cloud.consul.discovery.health-check-path=/management/health", | ||
"spring.cloud.consul.discovery.tags[0][email protected]@", | ||
"spring.cloud.consul.discovery.tags[1]=context-path=${server.servlet.context-path:}", | ||
"spring.cloud.consul.host=localhost", | ||
"spring.cloud.consul.port=8500" | ||
"spring.cloud.consul.discovery.tags[2]=profile=${spring.profiles.active:}", | ||
"spring.cloud.consul.discovery.tags[3]=git-version=${git.commit.id.describe:}", | ||
"spring.cloud.consul.discovery.tags[4]=git-commit=${git.commit.id.abbrev:}", | ||
"spring.cloud.consul.discovery.tags[5]=git-branch=${git.branch:}" | ||
) | ||
); | ||
|
||
|
@@ -85,7 +87,7 @@ public static void assertProperties(Project project) { | |
|
||
public static void assertDockerConsul(Project project) { | ||
assertFileExist(project, "src/main/docker/consul.yml"); | ||
|
||
assertFileContent(project, "src/main/docker/consul.yml", getDockerConsulImage()); | ||
assertFileExist(project, "src/main/docker/central-server-config/application.yml"); | ||
} | ||
} |