Update Code from Git/Bitbucket to live server

☆樱花仙子☆ 提交于 2019-11-29 01:36:32

问题


How can i update my live server with the changes i made through Git/Bitbucket?

Is there any free service ?

Is it possible to do it with some kind of API which can be integrated with cronjob?


回答1:


You could use the BitBucket service hooks.
They are illustrated in "Using Bitbucket for Automated Deployments", and that article uses the POST service.

Bitbucket POSTs to the service URL you specify.
The service receives an POST whenever user pushes to the repository.
The content header of the POST has an application/x-www-form-urlencoded type.
This services behaves similarly to an HTTP publish/subscribe service.
The payload has payload= prepended to the actual payload. The payload is url encode content.

The body of POST request contains information about the repository where the change originated, a list of recent commits, and the user that made the push.


Regarding GitHub, see this process which describes how to use the Post-receive hook



来源:https://stackoverflow.com/questions/13243694/update-code-from-git-bitbucket-to-live-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!