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

时间:2014-04-21 21:54:46

标签: github openshift

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

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

1 个答案:

答案 0 :(得分:7)

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

然而,让我们探讨一些可能性:

  1. 使用多个网址配置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接收到一个请求。您可能需要通过 ctl_app 重新启动应用程序(请参阅https://www.openshift.com/kb/kb-e1055-how-to-restart-an-application
  3. 最后但并非最不重要的是,您可以在OpenShift中使用 .openshift / action_hooks / post_deploy 部署挂钩。重新部署应用程序后,我会被触发。在那里你也应该能够回购GitHub。
  4. 哪种方法最有意义取决于您的用例。

相关问题