From fc4865964bf2cf36301545d40ae01d357c25e560 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Fri, 20 Feb 2015 16:20:43 +0000 Subject: [PATCH] Fix multi-git samples in docs --- README.adoc | 31 +++++++++++++++++-- docs/src/main/asciidoc/quickstart.adoc | 15 ++------- .../main/asciidoc/spring-cloud-config.adoc | 25 ++++++++------- 3 files changed, 44 insertions(+), 27 deletions(-) diff --git a/README.adoc b/README.adoc index 7b8473f4..2d5694e9 100644 --- a/README.adoc +++ b/README.adoc @@ -50,7 +50,9 @@ The default strategy for locating property sources is to clone a git repository (at "spring.cloud.config.server.git.uri") and use it to initialize a mini `SpringApplication`. The mini-application's `Environment` is used to enumerate property sources and publish them -via a JSON endpoint. The service has resources in the form: +via a JSON endpoint. + +The HTTP service has resources in the form: ---- /{application}/{profile}[/{label}] @@ -64,10 +66,35 @@ where the "application" is injected as the "spring.config.name" in the `SpringApplication` (i.e. what is normally "application" in a regular Spring Boot app), "profile" is an active profile (or comma-separated list of properties), and "label" is an optional git label (defaults to -"master".) The YAML and properties forms are coalesced into a single +"master".) + +The YAML and properties forms are coalesced into a single map, even if the origin of the values (reflected in the "propertySources" of the "standard" form) has multiple sources. +Spring Cloud Config Server also supports multiple git repositories: + +---- +spring: + cloud: + config: + server: + git: + uri: https://github.com/spring-cloud-samples/config-repo + repos: + - patterns: *pattern + uri: https://github.com/pattern1/config-repo + - patterns: pattern*,*pattern1* + uri: https://github.com/pattern2/config-repo + - patterns: local* + uri: file:/home/configsvc/config-repo +---- + +In the above example, if {application} does not match to any of the patterns +under "spring.cloud.config.server.git.repos", it will use the default uri +defined under "spring.cloud.config.server.git.uri". Acceptable pattern +format is "*xxx", "xxx*", or "*xxx*". + === Client Side Usage To use these features in an application, just build it as a Spring diff --git a/docs/src/main/asciidoc/quickstart.adoc b/docs/src/main/asciidoc/quickstart.adoc index 90cb4f5a..00881857 100644 --- a/docs/src/main/asciidoc/quickstart.adoc +++ b/docs/src/main/asciidoc/quickstart.adoc @@ -43,7 +43,8 @@ The YAML and properties forms are coalesced into a single map, even if the origin of the values (reflected in the "propertySources" of the "standard" form) has multiple sources. -Spring Cloud Config Server also supports multiple git repositories: +Spring Cloud Config Server pulls configuration for remote clients +from a git repository (which must be provided): ---- spring: @@ -52,20 +53,8 @@ spring: server: git: uri: https://github.com/spring-cloud-samples/config-repo - repos: - - patterns: *pattern - uri: https://github.com/pattern1/config-repo - - patterns: pattern*,*pattern1* - uri: https://github.com/pattern2/config-repo - - patterns: local* - uri: file:/home/configsvc/config-repo ---- -In the above example, if {application} does not match to any of the patterns -under "spring.cloud.config.server.git.repos", it will use the default uri -defined under "spring.cloud.config.server.git.uri". Acceptable pattern -format is "*xxx", "xxx*", or "*xxx*". - === Client Side Usage To use these features in an application, just build it as a Spring diff --git a/docs/src/main/asciidoc/spring-cloud-config.adoc b/docs/src/main/asciidoc/spring-cloud-config.adoc index dec24717..ddbb725a 100644 --- a/docs/src/main/asciidoc/spring-cloud-config.adoc +++ b/docs/src/main/asciidoc/spring-cloud-config.adoc @@ -85,23 +85,24 @@ working copy as a cache. This repository implementation maps the `{label}` parameter of the HTTP resource to a git label (commit id, branch name or tag). -Spring Cloud Config Server also supports multiple git repositories: +Spring Cloud Config Server supports a single or multiple git +repositories: ---- spring: cloud: config: - server: - git: - uri: https://github.com/spring-cloud-samples/config-repo - repos: - simple: https://github.com/pattern1/config-repo + server: + git: + uri: https://github.com/spring-cloud-samples/config-repo + repos: + simple: https://github.com/pattern1/config-repo special: pattern: pattern*,*pattern1* - uri: https://github.com/pattern2/config-repo - local: + uri: https://github.com/pattern2/config-repo + local: pattern: local* - uri: file:/home/configsvc/config-repo + uri: file:/home/configsvc/config-repo ---- In the above example, if {application} does not match to any of the @@ -119,9 +120,9 @@ e.g. spring: cloud: config: - server: - git: - uri: https://github.com/spring-cloud-samples/config-repo + server: + git: + uri: https://github.com/spring-cloud-samples/config-repo username: trolley password: strongpassword ----