History for Wiki Page Post-Commit-Webhooks

Page: 12
15 years ago
rs picture

Text: h1. XP-Dev.com Post Commit Webhooks Example: bc.. { "message":"some changes for tomorrows release", "timestamp":1235327991226, "author":"rs", "revision":652, "repository_ssl_path":"https://localsvn/svn/rs-importable/", "added":["/trunk/pyserver/something"], "revision_web":"http://xpweb-local/svnview/changeset/3/652/", "repository":"rs-importable", "repository_path":"http://localsvn/svn/rs-importable/", "removed":["/trunk/pyserver/bootstrap/compile.py"], "replaced":[], "modified":["/trunk/pyserver/build.properties"] } p. Some descriptionsh1. XP-Dev.com Subversion Post Commit Webhooks "Webhooks":http://webhooks.pbwiki.com/ are a very useful feature for version control systems. h2. Enabling Webhooks To enable webhooks on your Subversion repository: # Head over to your "subversion homepage":/subversion/ # Select the repository that you want to enable # *Edit* the repository # Enter a URL under *Commit URL* # Save the repository Now, whenever a new revision has been committed into the repository, XP-Dev.com will submit a "JSON":http://www.json.org/ message to your URL in the method body. h2. Format You will get a new request on the URL for each commit. The format of the JSON message is below: bc.. { "repository":Name of the repository (Type:String), "message": Commit log message (Type:String), "timestamp": Timestamp of commit (Unix epoch in miliseconds) (Type:long), "author": Committer (Type:String), "revision": Commit revision (Type:long), "repository_ssl_path": Full SSL URL to the repository root (Type:String), "repository_path": Full non-SSL URL to the repository root (Type:String), "revision_web": Url to view the changeset on XP-Dev.com (Type:String), "added":List of paths that have been added (Type:String array), "removed":List of paths that have been removed/deleted (Type:String array), "replaced":List of paths that have been replaced (Type:String array), "modified":List of paths that have been modifed (Type:String array) } p. An example of the JSON message is below: bc.. { "message":"some changes for tomorrows release", "timestamp":1235327991226, "author":"rs", "revision":652, "repository_ssl_path":"https://localsvn/svn/rs-importable/", "added":["/trunk/pyserver/something"], "revision_web":"http://xpweb-local/svnview/changeset/3/652/", "repository":"rs-importable", "repository_path":"http://localsvn/svn/rs-importable/", "removed":["/trunk/pyserver/bootstrap/compile.py"], "replaced":[], "modified":["/trunk/pyserver/build.properties"] } h3. Example Code to Receive the Data PHP example: bc.. <?php $json = file_get_contents('php://input'); var_dump(json_decode($json)); ?>

rs picture
Page: 12