SpringCloud git2consul與配置

2023-12-04 16:13 更新

git2consul是一個(gè)Consul社區(qū)項(xiàng)目,它從git存儲(chǔ)庫(kù)中將文件加載到Consul中的各個(gè)鍵中。默認(rèn)情況下,鍵的名稱是文件的名稱。YAML和Properties文件分別受文件擴(kuò)展名.yml.properties的支持。spring.cloud.consul.config.format屬性設(shè)置為FILES。例如:

bootstrap.yml。 

spring:
  cloud:
    consul:
      config:
        format: FILES

給定/config中的以下鍵,development配置文件和應(yīng)用程序名稱foo

.gitignore
application.yml
bar.properties
foo-development.properties
foo-production.yml
foo.properties
master.ref

將創(chuàng)建以下屬性源:

config/foo-development.properties
config/foo.properties
config/application.yml

每個(gè)密鑰的值必須是格式正確的YAML或Properties文件。

以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)