开发者

standard way of setting a webserver deploy using webhooks

I am working on code for a webserver. I am trying to use webhooks to do the following tasks, after each push to the repository:

  1. update the code on the webserver.
  2. restart the server to make my changes take effect.

I know how to make the revision control run the webhook.

Regardless of the specifics of which revision control etc. I am using,开发者_JAVA百科 I would like to know what is the standard way to create a listener to the POST call from the webhook in LINUX.

I am not completely clueless - I know how to make a HTTP server in python and I can make it run the appropriate bash commands, but that seems so cumbersome. Is there a more straightforward way?


  1. Setup a script to receive the POST request ( a PHP script would be enough )
  2. Save the request into database and mark the request as "not yet finished"
  3. Run a crontab and check the database for "not yet finished" tasks, and do whatever you want with the information you saved into database.

This is definately not the best solution but it works.


You could use IronWorker, http://www.iron.io, to ssh in and perform your tasks on every commit. And to kick off the IronWorker task you can use it's webhook support. Here's a blog post that shows you how to use IronWorker's webhooks functionality and the post already has half of what you want (it starts a task based on a github commit): http://blog.iron.io/2012/04/one-webhook-to-rule-them-all-one-url.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜