문제

What is the best way to automate syn between Github repository and Openshift ?

I found this documentation in openshift : https://www.openshift.com/forums/openshift/how-to-keep-a-github-repository-and-an-openshift-repository-in-sync For manually doing a syncrhonisation.

도움이 되었습니까?

해결책

I guess the first question is why you want to automate it? What do you want to achieve? In many cases a manual push to Openshift and GitHub might be preferable.

However, let's explore some possibilities:

  1. Configure a git remote with multiple urls and then just git push all. See also Able to push to all git remotes with the one command?
  2. Use a GitHub Webhook - https://developer.github.com/webhooks/creating/. GutHub will then send a HTTP request to a given URL on each push. You can then setup something on your openshift gear which listens to the request and if it receives one pulls from GitHub. you might then need to restart the app via ctl_app (see https://www.openshift.com/kb/kb-e1055-how-to-restart-an-application)
  3. Last but not least, you could make use of the .openshift/action_hooks/post_deploy deploy hook in OpenShift. I gets triggered after redeploy of your application. In there you should be able to the repo to GitHub as well.

Which approach makes most sense will depend on your use case.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top