adding webhook capability to SVN server

╄→尐↘猪︶ㄣ 提交于 2019-12-02 02:12:41

问题


I am trying to create and endpoint to receive a post-commit notification of a configured webhook in a SVN server. I have not figured out how to add the webhook capability to SVN server but I found that allura provides this feature. Is it the official layer for adding webhooks to SVN or there is another way?


回答1:


Any Subversion server can have hooks. They are a built-in feature of the server. You can see here:

http://svnbook.red-bean.com/en/1.8/svn.reposadmin.create.html#svn.reposadmin.create.hooks

It is up to you to write or supply the actual hook but there are likely examples that exist for most anything you want to do. For a webhook this could be a simple as a shell script that takes the input from the hook and POST's it to some URL using curl. If necessary, maybe your script uses the svnlook command to extract some of the details from the commit that it includes in the payload you post.

One example you can Google for is called "svnpubsub". This is a hook script that posts the info to a server that also manages subscribers that want to receive the info. Even if you do not want to use this exact tool, the hook script it uses to collect the commit data is likely a good starting point.

http://svn.apache.org/repos/asf/subversion/trunk/tools/server-side/svnpubsub/



来源:https://stackoverflow.com/questions/42930025/adding-webhook-capability-to-svn-server

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