[英]Spring Cloud Config Server + BitBucket
我正在嘗試使用BitBucket私有存儲庫來安裝Spring Cloud的Config Server並且沒有任何運氣。 無論我使用什么配置,我總是在嘗試加載配置時返回404。
我也嘗試在JGitEnvironmentRepository
設置斷點,但它似乎永遠不會在JGitEnvironmentRepository
之外afterPropertiesSet
。 如果我在調試時手動觸發findOne(application,profile,label)
,則會收到錯誤,即Branch name <null> not allowed
。 如果我為label
屬性指定“master”,那么我得到了可怕的Ref master cannot be resolved
錯誤。
該應用程序加載正常但沒有結果。 從我讀過的所有文檔中,看起來這應該是開箱即用的。 任何幫助,將不勝感激。
bootstrap.yml
server:
port: 8888
spring:
application:
name: config-service
cloud:
bus.amqp.enabled: false
config:
enabled: false
failFast: true
server:
prefix: /configs
git :
uri: https://bitbucket.org/[team]/[repo].git
username: [user]
password: [pass]
回購文件
- demo.app.yml
嘗試過的網址
您需要在網址中添加個人資料名稱。 默認配置文件是“默認”。 HTTP://本地主機:8888 / CONFIGS / demo.app /默認
這僅適用於我的1.0.0.RELEASE版本,但是對於1.0.1.RELEASE版本我在Windows上發現了一個問題(文件分隔符存在問題,因此配置服務器未找到YAML文件本地克隆的存儲庫)。 也許這是相關的問題: Spring Cloud Config | Git Based | 不在Windows機器上工作
如果您仍有任何問題,可以參考以下客戶端配置。 我已經成功配置了bitbucket存儲庫。
Spring Boot Version: 1.4.1.RELEASE
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Camden.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
-----------------------------------------------------------------------
bootstrap.yml
spring:
application:
name: client-config
cloud:
config:
failFast: true
label: master
profile: default
username: <username>
password: <password>
server:
bootstrap: true
uri: http://localhost:8888
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.