I'm looking at implementing the 12factor approach to externalising config via Spring Cloud Config but am not able to get the wildcards working using searchPaths as I expected.
The documentation http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#_spring_cloud_config_server mentions that wildcards {application}, {label}, {profile} can be used within the searchPaths variable so that "you can segregate the directories in the path, and choose a strategy that makes sense for you (e.g. sub-directory per application, or sub-directory per profile)."
I'm looking to have a single git repo, with either subdirectories per profile (and then per app, or subdirectory per app (then by profile).
e.g.
spring:
cloud:
config:
server:
git:
uri: https://stash.xxx.com.au/scm/xxx/config
searchPaths: {application}
or
searchPaths: {profile}
or
searchPaths: {application}/{profile}
However when I use any of the wildcards {application} or {profile} in my searchPaths it doesn't find the data in the git repo, or for the concatenated option fails to startup at all.
Does anyone have a working example of this I can refer to? Cheers Roy
Use single quote and it works fine.
searchPaths: '{application}'
Hope this helps if someone stumbles across this problem.
Actually none of the examples in the user guide show the pattern being used in a list of searchPaths
. I don't think that feature is supported with the GIT backend (but {application}
is effectively the default in the filesystem backend, i.e. the one that works in the "native" profile).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With