Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring cloud config organising files in folders

I'm trying to organise a set of config files in folders within my Git repo. I read in the Spring Cloud Docs this can be done this way:

The HTTP service has resources in the form:

/{application}/{profile}[/{label}] 

/{application}-{profile}.yml

/{label}/{application}-{profile}.yml

/{application}-{profile}.properties

/{label}/{application}-{profile}.properties

So I created my config structure following the first pattern:

app1/uat/application.yml

But the Config service doesn't find it. It doesn't really say much about what the files inside the profile folder should look like, and everywhere I see examples of the 2nd and 4th patterns.

Does the first pattern actually work? Can anybody give an example?

like image 905
Amin Abu-Taleb Avatar asked May 16 '16 10:05

Amin Abu-Taleb


1 Answers

Solved, just needed to add:

spring:
  cloud:
    config:
      server:
        git:
          uri: https://github.com/your-repo
          searchPaths: '{application}/{profile}'

That will do the trick

like image 166
Amin Abu-Taleb Avatar answered Oct 05 '22 16:10

Amin Abu-Taleb