[英]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.