spring-cloud-config - 带有裸本地存储库的 Spring-Cloud-Config
问题描述
我需要在无法访问配置 git-repo 的环境中使用 spring-cloud-config-server。
我们设置了一个 Jenkins 作业,它将git clone --mirror
存储库镜像 () 到 cloud-config-server (/opt/foo.git),现在我想将其用作源。
我的第一个想法是使用
uri: file://opt/foo.git
但这失败了
"java.lang.IllegalStateException: No .git at file://opt/foo.git
将裸仓库移动到子文件夹 .git 也不起作用。所以我做了一些研究,spring-cloud-config 服务器似乎对所有带file:
前缀的 url 进行了特殊处理,这可以防止克隆这个存储库。
我目前的解决方法是创建一个新的本地存储库/opt/foo2
,它具有/opt/foo.git
远程。
来自 spring-cloud-config-server 的任何调用现在都可以访问/opt/foo2
,如果存在任何更新,则会更新/opt/foo.git
本地存储库。好用,但感觉有点脏……
您是否看到此用例的任何其他选项不涉及让本地 Web 服务器为 git 镜像提供服务?;)
解决方案
推荐阅读
- python-3.x - AttributeError:“MpoImageFile”对象没有属性“形状”
- html - 如何更新 div 的 html 内容,使其在用户看来流畅
- php - php 升级到 7.2(Wordpress/Virtualmin)后出现错误 500
- javascript - Angular8 动画 - 以拖放方式扩展元素宽度
- arrays - 仅当搜索栏文本不为空时,如何运行过滤器功能?
- vee-validate - vee:以编程方式设置复选框值时验证需要失败
- c# - 使用 C# 代码在 JSON 中搜索键和值
- flutter - JSON 文件未在 Flutter 上加载
- javascript - 在其中心显示圆的半径
- erp - 我们如何在 Infor syteline 中添加自定义字段