10

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?

niksmac
  • 2,667
  • 3
  • 34
  • 50

1 Answers1

12

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

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank for this. And what about Github. Or any fee tools ? – niksmac Nov 06 '12 at 09:03
  • Thanks for that. And what if i want to transfer the files to webserver? is it possible ? – niksmac Nov 06 '12 at 10:22
  • @NikhilMohan one way would be for your post to trigger on the server a script which would git fetch from GitHub/BitBucket and then checkout in the live server repo. See the links in http://stackoverflow.com/questions/12732851/maintain-multiple-simultaneously-accessible-versions-of-website-remotely-using-g/12740518#12740518 – VonC Nov 06 '12 at 10:34