Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update Code from Git/Bitbucket to live server

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?

like image 490
niksmac Avatar asked Nov 06 '12 02:11

niksmac


1 Answers

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

WebHookURLs

like image 107
VonC Avatar answered Dec 19 '22 10:12

VonC