From 19cabfaa11a1bb9584f928f194a70b8d06bc0144 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Fri, 25 Sep 2015 09:56:46 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- spring-cloud-config.html | 67 ++++++++++++++++++++++++++++++++++------ 1 file changed, 58 insertions(+), 9 deletions(-) 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:

@@ -839,7 +842,7 @@ repositories:

repos: simple: https://github.com/simple/config-repo special: - pattern: pattern*,*pattern1* + pattern: special*/dev*,*special*/dev* uri: https://github.com/special/config-repo local: pattern: local* @@ -847,12 +850,14 @@ repositories:

-

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).

@@ -870,6 +875,50 @@ form.
+

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:

@@ -1553,7 +1602,7 @@ grabbing it in the bootstrap context and injecting one).