Sync docs from version-response to gh-pages
This commit is contained in:
@@ -431,6 +431,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
||||
<li><a href="#_using_multiple_keys_and_key_rotation">Using Multiple Keys and Key Rotation</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_serving_plain_text">Serving Plain Text</a></li>
|
||||
<li><a href="#_embedding_the_config_server">Embedding the Config Server</a></li>
|
||||
<li><a href="#_push_notifications_and_spring_cloud_bus">Push Notifications and Spring Cloud Bus</a></li>
|
||||
<li><a href="#_spring_cloud_config_client">Spring Cloud Config Client</a>
|
||||
@@ -826,7 +827,10 @@ them from the shell with quotes '').</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Config Server supports a single or multiple git
|
||||
repositories:</p>
|
||||
repositories with pattern matching on the application and profile
|
||||
name. The pattern format is a comma-separated list of
|
||||
<code>{application}/{profile}</code> names with wildcards (where a pattern
|
||||
beginning with a wildcard may need to be quoted). Example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
@@ -839,7 +843,7 @@ repositories:</p>
|
||||
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 +851,14 @@ repositories:</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>In the above example, if <code>{application}</code> 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).</p>
|
||||
<p>If <code>{application}/{profile}</code> 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 <code>simple/*</code> (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 <code>/*</code> suffix is added automatically to any pattern that
|
||||
doesn’t have a profile matcher).</p>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
@@ -870,6 +876,50 @@ form.
|
||||
</table>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The <code>pattern</code> property in the repo is actually an array, so you can
|
||||
use a YAML array (or <code>[0]</code>, <code>[1]</code>, 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:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre>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</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<div class="title">Note</div>
|
||||
</td>
|
||||
<td class="content">
|
||||
Spring Cloud will guess that a pattern containing a profile that
|
||||
doesn’t end in <code>*</code> implies that you actually want to match a list of
|
||||
profiles starting with this pattern (so <code>*/staging</code> is a shortcut for
|
||||
<code>["*/staging", "*/staging,*"]</code>). This is common where you need to run
|
||||
apps in the "development" profile locally but also the "cloud" profile
|
||||
remotely, for instance.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Every repository can also optionally store config files in
|
||||
sub-directories, and patterns to search for those directories can be
|
||||
specified as <code>searchPaths</code>. For example at the top level:</p>
|
||||
@@ -1298,6 +1348,103 @@ handle all encryption as well as decryption.
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_serving_plain_text">Serving Plain Text</h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Instead of using the <code>Environment</code> abstraction (or one of the
|
||||
alternative representations of it in YAML or properties format) your
|
||||
applications might need generic plain text configuration files,
|
||||
tailored to their environment. The Config Server provides these
|
||||
through an additional endpoint at <code>/{name}/{profile}/{label}/{path}</code>
|
||||
where "name", "profile" and "label" have the same meaning as the
|
||||
regular environment endpoint, but "path" is a file name
|
||||
(e.g. <code>log.xml</code>). The source files for this endpoint are located in
|
||||
the same way as for the environment endpoints: the same search path is
|
||||
used as for properties or YAML files, but instead of aggregating all
|
||||
matching resources, only the first one to match is returned.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>After a resource is located, placeholders in the normal format
|
||||
(<code>${…​}</code>) are resolved using the effective <code>Environment</code> for the
|
||||
application name, profile and label supplied. In this way the resource
|
||||
endpoint is tightly integrated with the environment
|
||||
endpoints. Example, if you have this layout for a GIT (or SVN)
|
||||
repository:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre>application.yml
|
||||
nginx.conf</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>where <code>nginx.conf</code> looks like this:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre>server {
|
||||
listen 80;
|
||||
server_name ${nginx.server.name};
|
||||
}</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>and <code>application.yml</code> like this:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlight"><code class="language-yaml" data-lang="yaml">nginx:
|
||||
server:
|
||||
name: example.com
|
||||
---
|
||||
spring:
|
||||
profiles: development
|
||||
nginx:
|
||||
server:
|
||||
name: develop.com</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>then the <code>/foo/default/master/nginx.conf</code> resource looks like this:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre>server {
|
||||
listen 80;
|
||||
server_name example.com;
|
||||
}</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>and <code>/foo/development/master/nginx.conf</code> like this:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre>server {
|
||||
listen 80;
|
||||
server_name develop.com;
|
||||
}</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<div class="title">Note</div>
|
||||
</td>
|
||||
<td class="content">
|
||||
just like the source files for environment configuration, the
|
||||
"profile" is used to resolve the file name, so if you want a
|
||||
profile-specific file then <code>/*/development/*/logback.xml</code> will be
|
||||
resolved by a file called <code>logback-development.xml</code> (in preference
|
||||
to <code>logback.xml</code>).
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_embedding_the_config_server">Embedding the Config Server</h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
@@ -1321,8 +1468,8 @@ initialize the same way as any other application.</p>
|
||||
<h2 id="_push_notifications_and_spring_cloud_bus">Push Notifications and Spring Cloud Bus</h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Many source code repository providers (like Github or Gitlab for
|
||||
instance) will notify you of changes in a repository through a
|
||||
<p>Many source code repository providers (like Github, Gitlab or Bitbucket
|
||||
for instance) will notify you of changes in a repository through a
|
||||
webhook. You can configure the webhook via the provider’s user
|
||||
interface as a URL and a set of events in which you are
|
||||
interested. For instance
|
||||
@@ -1339,14 +1486,18 @@ is enabled.</p>
|
||||
might have changed. The change detection can be strategized, but by
|
||||
default it just looks for changes in files that match the application
|
||||
name (e.g. "foo.properties" is targeted at the "foo" application, and
|
||||
"application.properties" is targeted at all applications). The strategy if you want to override the behaviour is <code>PropertyPathNotificationExtractor</code> which accepts the request headers and body as parameters and returns a list of file paths that changed.</p>
|
||||
"application.properties" is targeted at all applications). The strategy
|
||||
if you want to override the behaviour is <code>PropertyPathNotificationExtractor</code>
|
||||
which accepts the request headers and body as parameters and returns a list
|
||||
of file paths that changed.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The default configuration works out of the box with Github or
|
||||
Gitlab. In addition to the JSON notifications from Github and Gitlab
|
||||
you can trigger a change notification by POSTing to "/monitor" with a
|
||||
form-encoded body parameters <code>path={name}</code>. This will broadcast to
|
||||
applications matching the "{name}" pattern (can contain wildcards).</p>
|
||||
<p>The default configuration works out of the box with Github, Gitlab or
|
||||
Bitbucket. In addition to the JSON notifications from Github, Gitlab
|
||||
or Bitbucket you can trigger a change notification by POSTing to
|
||||
"/monitor" with a form-encoded body parameters <code>path={name}</code>. This will
|
||||
broadcast to applications matching the "{name}" pattern (can contain
|
||||
wildcards).</p>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
@@ -1553,7 +1704,7 @@ grabbing it in the bootstrap context and injecting one).</p>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<div id="footer-text">
|
||||
Last updated 2015-09-24 16:11:29 UTC
|
||||
Last updated 2015-10-01 18:48:05 UTC
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user