[英]Spring Cloud Config - Git backend
我瀏覽了 Spring Cloud Config 的文檔,我了解到 Spring 更喜歡使用 Git 作為配置存儲庫,因為它支持標簽/分支等,它也是 Spring Cloud Config 的默認選項。
現在我有兩個問題
請求任何人提供對這些問題的見解。
您可以將配置服務器與存儲在主機上的本地屬性文件一起使用。 為此,您只需使用具有以下屬性的本機profile
spring.profiles.active=native
spring.cloud.config.server.native.searchLocations=file:///C:/path/to/your/config/folder
然后不再需要以下屬性來設置您的 Git 存儲庫:
#spring.cloud.config.server.git.uri=...
#spring.cloud.config.server.git.username=...
#spring.cloud.config.server.git.password=...
#spring.cloud.config.server.git.timeout=10
#spring.cloud.config.server.git.clone-on-start=true
您可以禁用 Git ssl config - git config --global http.sslVerify false
創建一個 Git 個人訪問令牌。 使用令牌保存在 spring.cloud.config.token 屬性中。 在 application.yml 中使用下面的配置
服務器:
git:
uri: https://github.com/AKS/config/
OR
uri: file:///AKS/config/
skipSslValidation: true
search-paths:
- config-map
try-master-branch: false
username: user
password: ******
default-label: <branch-name-git-branch>
clone-on-start: true
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.