SpringCloud git2consul与配置
git2consul是一个Consul社区项目,它从git存储库中将文件加载到Consul中的各个键中。默认情况下,键的名称是文件的名称。YAML和Properties文件分别受文件扩展名.yml和.properties的支持。将spring.cloud.consul.config.format属性设置为FILES。例如:
bootstrap.yml。
spring:
cloud:
consul:
config:
format: FILES
给定/config中的以下键,development配置文件和应用程序名称foo:
.gitignore application.yml bar.properties foo-development.properties foo-production.yml foo.properties master.ref
将创建以下属性源:
config/foo-development.properties config/foo.properties config/application.yml
每个密钥的值必须是格式正确的YAML或Properties文件。