Optional support for multiple Git repos

This implementation adds multiple git repositories support to Spring Cloud Config Server.
By giving the following properties file:

info:
  component: Config Server
spring:
  application:
    name: configserver
  jmx:
    default_domain: cloud.config.server
  cloud:
    config:
      server:
        git:
          uri: https://github.com/spring-cloud-samples/config-repo
          repos:
            - patterns: iceycake-*
              uri: https://github.com/iceycake/config-repo
            - patterns: project1-*,*-project1
              uri: https://github.com/spring-cloud-samples/config-repo-1
with uri:

  /{application}/{profile}/{label}

where

spring.cloud.config.server.git.uri is the default git repository
spring.cloud.config.server.repos is a mapping between a git repository and
a string pattern that matches the {application} string in the endpoint.

Fixes gh-82, fixes gh-58
This commit is contained in:
Andy Chan
2015-02-05 15:08:32 -08:00
committed by Dave Syer
parent 2d63d598db
commit e05e876f8f
37 changed files with 995 additions and 6 deletions

View File

@@ -43,6 +43,29 @@ 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

View File

@@ -85,6 +85,30 @@ 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:
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*".
==== File System Backend
There is also a "native" profile in the Config Server that doesn't use