gpt4 book ai didi

github - 如何在 Github 存储库和 Openshift 之间自动同步?

转载 作者:行者123 更新时间:2023-12-02 08:38:38 25 4
gpt4 key购买 nike

在 Github 存储库和 Openshift 之间自动化同步的最佳方法是什么?

我在 openshift 中找到了这个文档:https://www.openshift.com/forums/openshift/how-to-keep-a-github-repository-and-an-openshift-repository-in-sync用于手动进行同步。

最佳答案

我想第一个问题是为什么你想自动化它?你想实现什么目标?在许多情况下,手动推送到 Openshift 和 GitHub 可能更可取。

但是,让我们探索一些可能性:

  1. 配置一个具有多个 URL 的 git 远程服务器,然后只需git push all。另请参阅Able to push to all git remotes with the one command?
  2. 使用 GitHub Webhook - https://developer.github.com/webhooks/creating/ 。然后,GutHub 将在每次推送时向给定 URL 发送 HTTP 请求。然后,您可以在 openshift gear 上设置一些东西来监听请求,以及是否收到来自 GitHub 的拉取。然后,您可能需要通过 ctl_app 重新启动应用程序(请参阅 https://www.openshift.com/kb/kb-e1055-how-to-restart-an-application )
  3. 最后但并非最不重要的一点是,您可以使用 OpenShift 中的 .openshift/action_hooks/post_deploy 部署 Hook 。重新部署您的应用程序后我会被触发。在那里您还应该能够访问 GitHub 的存储库。

哪种方法最有意义取决于您的用例。

关于github - 如何在 Github 存储库和 Openshift 之间自动同步?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23206686/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com