Configuring multiple repositories using patterns

Spring Cloud Config also supports configurations for multiple repositories using matching patterns of the application and profile name. The pattern can be configured in multiple ways, such as a comma-separated list of {application}/{profile} names with wildcards.

Let's look at the following configuration for the pattern matching multiple repositories configuration:

spring: 
  cloud: 
    config: 
      server: 
        git: 
          uri: https://github.com/dineshonjava/app-config-repo 
          repos: 
                dev:  
                  pattern: 
                    - '*/development' 
                    - '*/staging' 
                  uri:  
https://github.com/dineshonjava/development/app-config-repo 
                staging: 
                    pattern: 
                      - '*/qa' 
                      - '*/production' 
                    uri: https://github.com/dineshonjava/staging/app-config-repo

As you can see, we ...

Get Mastering Spring Boot 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.