【问题标题】:How to automate sync between a Github repository and Openshift?如何在 Github 存储库和 Openshift 之间自动同步?
【发布时间】:2014-04-21 21:54:45
【问题描述】:

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

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

【问题讨论】:

    标签: github openshift


    【解决方案1】:

    我想第一个问题是你为什么要自动化它?你想达到什么目标?在许多情况下,手动推送到 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 设备上设置一些东西来监听请求,如果它从 GitHub 接收到一个 pull。然后您可能需要通过 ctl_app 重新启动应用程序(请参阅 https://www.openshift.com/kb/kb-e1055-how-to-restart-an-application
    3. 最后但同样重要的是,您可以在 OpenShift 中使用 .openshift/action_hooks/post_deploy 部署挂钩。重新部署您的应用程序后,我会被触发。在那里,您应该也可以将 repo 存储到 GitHub。

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

    【讨论】:

      猜你喜欢
      • 2021-09-29
      • 1970-01-01
      • 2015-12-21
      • 1970-01-01
      • 1970-01-01
      • 2013-01-10
      • 1970-01-01
      • 2011-07-30
      • 1970-01-01
      相关资源
      最近更新 更多