diff --git a/spring-cloud-config.html b/spring-cloud-config.html index fe4de534..d6e9300a 100644 --- a/spring-cloud-config.html +++ b/spring-cloud-config.html @@ -826,7 +826,10 @@ them from the shell with quotes '').
Spring Cloud Config Server supports a single or multiple git -repositories:
+repositories with pattern matching on the application and profile +name. The pattern format is a comma-separated list of +{application}/{profile} names with wildcards (where a pattern
+beginning with a wildcard may need to be quoted). Example:
In the above example, if {application} does not match any of the
-patterns, it will use the default uri defined under
-"spring.cloud.config.server.git.uri". For the "simple" repository, the
-pattern is "simple" (i.e. it only matches one application named "simple").
-The pattern format is a comma-separated list of application names with
-wildcards (a pattern beginning with a wildcard may need to be quoted).
If {application}/{profile} does not match any of the patterns, it
+will use the default uri defined under
+"spring.cloud.config.server.git.uri". In the above example, for the
+"simple" repository, the pattern is simple/* (i.e. it only matches
+one application named "simple" in all profiles). The "local"
+repository matches all application names beginning with "local" in all
+profiles (the /* suffix is added automatically to any pattern that
+doesn’t have a profile matcher).
The pattern property in the repo is actually an array, so you can
+use a YAML array (or [0], [1], etc. suffixes in properties files)
+to bind to multiple patterns. You may need to do this if you are going
+to run apps with multiple profiles. Example:
spring: + cloud: + config: + server: + git: + uri: https://github.com/spring-cloud-samples/config-repo + repos: + development: + pattern: + - */development + - */staging + uri: https://github.com/development/config-repo + staging: + pattern: + - */qa + - */production + uri: https://github.com/staging/config-repo+
|
+ Note
+ |
+
+Spring Cloud will guess that a pattern containing a profile that
+doesn’t end in * implies that you actually want to match a list of
+profiles starting with this pattern (so */staging is a shortcut for
+["*/staging", "*/staging,*"]). This is common where you need to run
+apps in the "development" profile locally but also the "cloud" profile
+remotely, for instance.
+ |
+
Every repository can also optionally store config files in
sub-directories, and patterns to search for those directories can be
specified as searchPaths. For example at the top level: