git - 如何将外部 git 添加到正在运行的结构集合中
问题描述
我们有一个 fuse / fabric ensemble,我们希望使用外部 git,因为它有助于管理配置文件等。此外,我们想了解如何添加外部 git,以便我们可以将其应用到实际生产中,因为前面提到的一个是分期。
Fuse 文档只展示了如何使用外部 git 创建新的 ensemble,但没有提及如何使现有的 ensemble 使用它(尽管原则上它似乎并不难)。我们已经尝试过fabric:create --force
,但它失败了(半成品配置文件等),我们设法以某种方式手动恢复它。
有没有一种已知的方法如何移动现有的集合以使用外部 git(例如,停止一切,更改原始 url,例如开始,但是在哪里设置凭据?肯定fabric:create
会在某处存储配置,因此它不仅是原始 url,或者在严重断开连接的情况下可能会丢失)?或者,有没有办法创建“新”集合并将所有现有容器“移动”到它?
解决方案
为了使用外部 git,您必须配置io.fabric8.datastore
PID,它是default
配置文件的一部分(因此 - 可用于所有容器,因为所有配置文件都继承自default
)。
所以,在你已经创建了fabric:create
你的io.fabric8.datastore
集成(io.fabric8.datastore.properties
fabric:profile-edit --pid io.fabric8.datastore/gitRemoteUrl=https://github.com/my-org/my-repo.git default
fabric:profile-edit --pid io.fabric8.datastore/gitRemoteUser=my-user default
fabric:profile-edit --pid io.fabric8.datastore/gitRemotePassword=my-password default
在 Hawtio 控制台中,您可以事务性地执行此操作,避免部分更新io.fabric8.datastore
PID。
在切换 git 存储库之前,您必须将现有存储库推送到其他地方
实际的Fabric Git 存储库存储在 中FUSE_HOME/data/git/local/fabric
,因此您可以执行以下操作:
cd /tmp
git clone $FUSE_HOME/data/git/local/fabric/.git fabric-git
cd fabric-git
git remote add new-location https://github.com/my-org/my-repo.git
git push new-location --all
git push new-location --tags
cd ..
rm -rf fabric-git # as you no longer need it
推荐阅读
- php - 如何正确使用cookie来存储购物车?
- node.js - Node + Passport - 如何在不同的路由上实现基于 JWT 角色的身份验证?
- python - 从 git 安装时,我可以强制 pip 进行浅层结帐吗?
- php - TYPO3 不会在 Classes 文件夹中自动加载 PHP 文件
- vba - 如何在Word文档中快速查找和复制包含特定文本的段落?(或者,在Word文档中留下包含特定文本的段落?)
- c# - 随后将任务添加到任务中,但限制并行执行的数量
- google-cast - “谷歌智能音箱式广播通知”
- oracle - 有什么方法可以知道哪个查询导致“找不到数据”异常?
- angular - 如何在 Angular 中定义采用可选参数的 Route?
- spring - Spring boot ResourceUtils.getURL 非法访问:这个web应用