XP-Dev.com Subversion Post Commit Webhooks

User guide has been moved to the documentation site

http://docs.xp-dev.com/user-guide/webhooks.html

Post-Commit-Webhooks is a public wiki page

This wiki page is a public wiki page. It can be read by anyone including users that have not logged in and web crawlers such as Google.

Entry has no comments

You do not have sufficient permissions to comment

11 years ago
rs picture

Text: h1. XP-Dev.com Subversion Post Commit Webhooks "Webhooks":http://webhooks.pbwiki.com/ are a very useful feature for version control systems. {toc} 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://svn.xp-dev.com/svn/rs-importable/", "added":["/trunk/pyserver/something"], "revision_web":"http://xp-dev.com/svnview/changeset/3/652/", "repository":"rs-importable", "repository_path":"http://svn.xp-dev.com/svn/rs-importable/", "removed":["/trunk/pyserver/bootstrap/compile.py"], "replaced":[], "modified":["/trunk/pyserver/build.properties"] } h2. Example Code to Receive the Data PHP example: bc.. <?php $json = file_get_contents('php://input'); var_dump(json_decode($json)); ?> h2. Testing Your Webhook You can use "curl":http://curl.haxx.se/ to test your webhook. Head over to their "download page":http://curl.haxx.se/download.html and download the appropriate package for your platform. Running the following command will test that your webhook is installed correctly. Please do note that the webhook URL in the following example is set to *http://example.com/webhook.php*. You should change it to your own webhook URL. bc. curl -d '{"message":"svn:commit for logparser-1","timestamp":1223820987303,"author":"rs","revision":627,"repository_ssl_path":"https://svn.xp-dev.com/svn/rs-importable/","added":["/tags/logparser-1","/tags/logparser-1/src/python/reportgenerator.py"],"revision_web":"http://xp-dev.com/svnview/changeset/3/627/","repository":"rs-importable","repository_path":"http://svn.xp-dev.com/svn/rs-importable/","removed":[],"replaced":["/tags/logparser-1/src/sql","/tags/logparser-1/src","/tags/logparser-1/src/html","/tags/logparser-1/src/python","/tags/logparser-1/src/geoip"],"modified":[]}' http://example.com/webhook.php If you're using the "example webhook":#ExampleCodetoReceivetheData listed above, you should get the following output: bc.. object(stdClass)#1 (12) { ["message"]=> string(26) "svn:commit for logparser-1" ["timestamp"]=> float(1223820987300) ["author"]=> string(2) "rs" ["revision"]=> int(627) ["repository_ssl_path"]=> string(41) "https://svn.xp-dev.com/svn/rs-importable/" ["added"]=> array(2) { [0]=> string(17) "/tags/logparser-1" [1]=> string(47) "/tags/logparser-1/src/python/reportgenerator.py" } ["revision_web"]=> string(42) "http://xp-dev.com/svnview/changeset/3/627/" ["repository"]=> string(13) "rs-importable" ["repository_path"]=> string(40) "http://svn.xp-dev.com/svn/rs-importable/" ["removed"]=> array(0) { } ["replaced"]=> array(5) { [0]=> string(25) "/tags/logparser-1/src/sql" [1]=> string(21) "/tags/logparser-1/src" [2]=> string(26) "/tags/logparser-1/src/html" [3]=> string(28) "/tags/logparser-1/src/python" [4]=> string(27) "/tags/logparser-1/src/geoip" } ["modified"]=> array(0) { } } h1. XP-Dev.com Subversion Post Commit Webhooks User guide has been moved to the "documentation site":http://docs.xp-dev.com/user-guide/webhooks.html http://docs.xp-dev.com/user-guide/webhooks.html

rs picture

Text: h1. XP-Dev.com Subversion Post Commit Webhooks "Webhooks":http://webhooks.pbwiki.com/ are a very useful feature for version control systems. {toc} 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://svn.xp-dev.com/svn/rs-importable/", "added":["/trunk/pyserver/something"], "revision_web":"http://xp-dev.com/svnview/changeset/3/652/", "repository":"rs-importable", "repository_path":"http://svn.xp-dev.com/svn/rs-importable/", "removed":["/trunk/pyserver/bootstrap/compile.py"], "replaced":[], "modified":["/trunk/pyserver/build.properties"] } h2. Example Code to Receive the Data PHP example: bc.. <?php $json = file_get_contents('php://input'); var_dump(json_decode($json)); ?> h2. Testing Your Webhook You can use "curl":http://curl.haxx.se/ to test your webhook. Head over to their "download page":http://curl.haxx.se/download.html and download the appropriate package for your platform. Running the following command will test that your webhook is installed correctly. Please do note that the webhook URL in the following example is set to *http://example.com/webhook.php*. You should change it to your own webhook URL. bc. curl -d '{"message":"svn:commit for logparser-1","timestamp":1223820987303,"author":"rs","revision":627,"repository_ssl_path":"https://svn.xp-dev.com/svn/rs-importable/","added":["/tags/logparser-1","/tags/logparser-1/src/python/reportgenerator.py"],"revision_web":"http://xp-dev.com/svnview/changeset/3/627/","repository":"rs-importable","repository_path":"http://svn.xp-dev.com/svn/rs-importable/","removed":[],"replaced":["/tags/logparser-1/src/sql","/tags/logparser-1/src","/tags/logparser-1/src/html","/tags/logparser-1/src/python","/tags/logparser-1/src/geoip"],"modified":[]}' http://example.com/webhook.php If you're using the "example webhook":#ExampleCodetoReceivetheData listed above, you should the following output: bc.. object(stdClass)#1 (12) { ["message"]=> string(26) "svn:commit for logparser-1" ["timestamp"]=> float(1223820987300) ["author"]=> string(2) "rs" ["revision"]=> int(627) ["repository_ssl_path"]=> string(41) "https://svn.xp-dev.com/svn/rs-importable/" ["added"]=> array(2) { [0]=> string(17) "/tags/logparser-1" [1]=> string(47) "/tags/logparser-1/src/python/reportgenerator.py" } ["revision_web"]=> string(42) "http://xp-dev.com/svnview/changeset/3/627/" ["repository"]=> string(13) "rs-importable" ["repository_path"]=> string(40) "http://svn.xp-dev.com/svn/rs-importable/" ["removed"]=> array(0) { } ["replaced"]=> array(5) { [0]=> string(25) "/tags/logparser-1/src/sql" [1]=> string(21) "/tags/logparser-1/src" [2]=> string(26) "/tags/logparser-1/src/html" [3]=> string(28) "/tags/logparser-1/src/python" [4]=> string(27) "/tags/logparser-1/src/geoip" } ["modified"]=> array(0) { } } h1. XP-Dev.com Subversion Post Commit Webhooks "Webhooks":http://webhooks.pbwiki.com/ are a very useful feature for version control systems. {toc} 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://svn.xp-dev.com/svn/rs-importable/", "added":["/trunk/pyserver/something"], "revision_web":"http://xp-dev.com/svnview/changeset/3/652/", "repository":"rs-importable", "repository_path":"http://svn.xp-dev.com/svn/rs-importable/", "removed":["/trunk/pyserver/bootstrap/compile.py"], "replaced":[], "modified":["/trunk/pyserver/build.properties"] } h2. Example Code to Receive the Data PHP example: bc.. <?php $json = file_get_contents('php://input'); var_dump(json_decode($json)); ?> h2. Testing Your Webhook You can use "curl":http://curl.haxx.se/ to test your webhook. Head over to their "download page":http://curl.haxx.se/download.html and download the appropriate package for your platform. Running the following command will test that your webhook is installed correctly. Please do note that the webhook URL in the following example is set to *http://example.com/webhook.php*. You should change it to your own webhook URL. bc. curl -d '{"message":"svn:commit for logparser-1","timestamp":1223820987303,"author":"rs","revision":627,"repository_ssl_path":"https://svn.xp-dev.com/svn/rs-importable/","added":["/tags/logparser-1","/tags/logparser-1/src/python/reportgenerator.py"],"revision_web":"http://xp-dev.com/svnview/changeset/3/627/","repository":"rs-importable","repository_path":"http://svn.xp-dev.com/svn/rs-importable/","removed":[],"replaced":["/tags/logparser-1/src/sql","/tags/logparser-1/src","/tags/logparser-1/src/html","/tags/logparser-1/src/python","/tags/logparser-1/src/geoip"],"modified":[]}' http://example.com/webhook.php If you're using the "example webhook":#ExampleCodetoReceivetheData listed above, you should get the following output: bc.. object(stdClass)#1 (12) { ["message"]=> string(26) "svn:commit for logparser-1" ["timestamp"]=> float(1223820987300) ["author"]=> string(2) "rs" ["revision"]=> int(627) ["repository_ssl_path"]=> string(41) "https://svn.xp-dev.com/svn/rs-importable/" ["added"]=> array(2) { [0]=> string(17) "/tags/logparser-1" [1]=> string(47) "/tags/logparser-1/src/python/reportgenerator.py" } ["revision_web"]=> string(42) "http://xp-dev.com/svnview/changeset/3/627/" ["repository"]=> string(13) "rs-importable" ["repository_path"]=> string(40) "http://svn.xp-dev.com/svn/rs-importable/" ["removed"]=> array(0) { } ["replaced"]=> array(5) { [0]=> string(25) "/tags/logparser-1/src/sql" [1]=> string(21) "/tags/logparser-1/src" [2]=> string(26) "/tags/logparser-1/src/html" [3]=> string(28) "/tags/logparser-1/src/python" [4]=> string(27) "/tags/logparser-1/src/geoip" } ["modified"]=> array(0) { } }

rs picture

Text: h1. XP-Dev.com Subversion Post Commit Webhooks "Webhooks":http://webhooks.pbwiki.com/ are a very useful feature for version control systems. {toc} 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://svn.xp-dev.com/svn/rs-importable/", "added":["/trunk/pyserver/something"], "revision_web":"http://xp-dev.com/svnview/changeset/3/652/", "repository":"rs-importable", "repository_path":"http://svn.xp-dev.com/svn/rs-importable/", "removed":["/trunk/pyserver/bootstrap/compile.py"], "replaced":[], "modified":["/trunk/pyserver/build.properties"] } h2. Example Code to Receive the Data PHP example: bc.. <?php $json = file_get_contents('php://input'); var_dump(json_decode($json)); ?> h2. Testing Your Webhook You can use "curl":http://curl.haxx.se/ to test your webhook. Head over to their "download page":http://curl.haxx.se/download.html and download the appropriate package for your platform. Running the following command will test that your webhook is installed correctly. Please do note that the webhook URL in the following example is set to *http://example.com/webhook.php*. You should change it to your own webhook URL. bc. curl -d '{"message":"svn:commit for logparser-1","timestamp":1223820987303,"author":"rs","revision":627,"repository_ssl_path":"https://svn.xp-dev.com/svn/rs-importable/","added":["/tags/logparser-1","/tags/logparser-1/src/python/reportgenerator.py"],"revision_web":"http://xp-dev.com/svnview/changeset/3/627/","repository":"rs-importable","repository_path":"http://svn.xp-dev.com/svn/rs-importable/","removed":[],"replaced":["/tags/logparser-1/src/sql","/tags/logparser-1/src","/tags/logparser-1/src/html","/tags/logparser-1/src/python","/tags/logparser-1/src/geoip"],"modified":[]}' http://example.com/webhook.php If you're using the example webhook listed above, you should the following output: bc.. object(stdClass)#1 (12) { ["message"]=> string(26) "svn:commit for logparser-1" ["timestamp"]=> float(1223820987300) ["author"]=> string(2) "rs" ["revision"]=> int(627) ["repository_ssl_path"]=> string(41) "https://svn.xp-dev.com/svn/rs-importable/" ["added"]=> array(2) { [0]=> string(17) "/tags/logparser-1" [1]=> string(47) "/tags/logparser-1/src/python/reportgenerator.py" } ["revision_web"]=> string(42) "http://xp-dev.com/svnview/changeset/3/627/" ["repository"]=> string(13) "rs-importable" ["repository_path"]=> string(40) "http://svn.xp-dev.com/svn/rs-importable/" ["removed"]=> array(0) { } ["replaced"]=> array(5) { [0]=> string(25) "/tags/logparser-1/src/sql" [1]=> string(21) "/tags/logparser-1/src" [2]=> string(26) "/tags/logparser-1/src/html" [3]=> string(28) "/tags/logparser-1/src/python" [4]=> string(27) "/tags/logparser-1/src/geoip" } ["modified"]=> array(0) { } } h1. XP-Dev.com Subversion Post Commit Webhooks "Webhooks":http://webhooks.pbwiki.com/ are a very useful feature for version control systems. {toc} 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://svn.xp-dev.com/svn/rs-importable/", "added":["/trunk/pyserver/something"], "revision_web":"http://xp-dev.com/svnview/changeset/3/652/", "repository":"rs-importable", "repository_path":"http://svn.xp-dev.com/svn/rs-importable/", "removed":["/trunk/pyserver/bootstrap/compile.py"], "replaced":[], "modified":["/trunk/pyserver/build.properties"] } h2. Example Code to Receive the Data PHP example: bc.. <?php $json = file_get_contents('php://input'); var_dump(json_decode($json)); ?> h2. Testing Your Webhook You can use "curl":http://curl.haxx.se/ to test your webhook. Head over to their "download page":http://curl.haxx.se/download.html and download the appropriate package for your platform. Running the following command will test that your webhook is installed correctly. Please do note that the webhook URL in the following example is set to *http://example.com/webhook.php*. You should change it to your own webhook URL. bc. curl -d '{"message":"svn:commit for logparser-1","timestamp":1223820987303,"author":"rs","revision":627,"repository_ssl_path":"https://svn.xp-dev.com/svn/rs-importable/","added":["/tags/logparser-1","/tags/logparser-1/src/python/reportgenerator.py"],"revision_web":"http://xp-dev.com/svnview/changeset/3/627/","repository":"rs-importable","repository_path":"http://svn.xp-dev.com/svn/rs-importable/","removed":[],"replaced":["/tags/logparser-1/src/sql","/tags/logparser-1/src","/tags/logparser-1/src/html","/tags/logparser-1/src/python","/tags/logparser-1/src/geoip"],"modified":[]}' http://example.com/webhook.php If you're using the "example webhook":#ExampleCodetoReceivetheData listed above, you should the following output: bc.. object(stdClass)#1 (12) { ["message"]=> string(26) "svn:commit for logparser-1" ["timestamp"]=> float(1223820987300) ["author"]=> string(2) "rs" ["revision"]=> int(627) ["repository_ssl_path"]=> string(41) "https://svn.xp-dev.com/svn/rs-importable/" ["added"]=> array(2) { [0]=> string(17) "/tags/logparser-1" [1]=> string(47) "/tags/logparser-1/src/python/reportgenerator.py" } ["revision_web"]=> string(42) "http://xp-dev.com/svnview/changeset/3/627/" ["repository"]=> string(13) "rs-importable" ["repository_path"]=> string(40) "http://svn.xp-dev.com/svn/rs-importable/" ["removed"]=> array(0) { } ["replaced"]=> array(5) { [0]=> string(25) "/tags/logparser-1/src/sql" [1]=> string(21) "/tags/logparser-1/src" [2]=> string(26) "/tags/logparser-1/src/html" [3]=> string(28) "/tags/logparser-1/src/python" [4]=> string(27) "/tags/logparser-1/src/geoip" } ["modified"]=> array(0) { } }

rs picture

Text: h1. XP-Dev.com Subversion Post Commit Webhooks "Webhooks":http://webhooks.pbwiki.com/ are a very useful feature for version control systems. {toc} 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://svn.xp-dev.com/svn/rs-importable/", "added":["/trunk/pyserver/something"], "revision_web":"http://xp-dev.com/svnview/changeset/3/652/", "repository":"rs-importable", "repository_path":"http://svn.xp-dev.com/svn/rs-importable/", "removed":["/trunk/pyserver/bootstrap/compile.py"], "replaced":[], "modified":["/trunk/pyserver/build.properties"] } h2. Example Code to Receive the Data PHP example: bc.. <?php $json = file_get_contents('php://input'); var_dump(json_decode($json)); ?> h2. Testing Your Webhook You can use "curl":http://curl.haxx.se/ to test your webhook. Head over to their "download page":http://curl.haxx.se/download.html and download the appropriate package for your platform. Running the following command will test that your webhook is installed correctly. Please do note that the webhook URL in the following example is set to *http://example.com/webhook.php*. You should change it to your own webhook URL. bc. curl -d '{"message":"svn:commit for logparser-1","timestamp":1223820987303,"author":"rs","revision":627,"repository_ssl_path":"https://svn.xp-dev.com/svn/rs-importable/","added":["/tags/logparser-1","/tags/logparser-1/src/python/reportgenerator.py"],"revision_web":"http://xp-dev.com/svnview/changeset/3/627/","repository":"rs-importable","repository_path":"http://svn.xp-dev.com/svn/rs-importable/","removed":[],"replaced":["/tags/logparser-1/src/sql","/tags/logparser-1/src","/tags/logparser-1/src/html","/tags/logparser-1/src/python","/tags/logparser-1/src/geoip"],"modified":[]}' http://example.com/webhook.php h1. XP-Dev.com Subversion Post Commit Webhooks "Webhooks":http://webhooks.pbwiki.com/ are a very useful feature for version control systems. {toc} 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://svn.xp-dev.com/svn/rs-importable/", "added":["/trunk/pyserver/something"], "revision_web":"http://xp-dev.com/svnview/changeset/3/652/", "repository":"rs-importable", "repository_path":"http://svn.xp-dev.com/svn/rs-importable/", "removed":["/trunk/pyserver/bootstrap/compile.py"], "replaced":[], "modified":["/trunk/pyserver/build.properties"] } h2. Example Code to Receive the Data PHP example: bc.. <?php $json = file_get_contents('php://input'); var_dump(json_decode($json)); ?> h2. Testing Your Webhook You can use "curl":http://curl.haxx.se/ to test your webhook. Head over to their "download page":http://curl.haxx.se/download.html and download the appropriate package for your platform. Running the following command will test that your webhook is installed correctly. Please do note that the webhook URL in the following example is set to *http://example.com/webhook.php*. You should change it to your own webhook URL. bc. curl -d '{"message":"svn:commit for logparser-1","timestamp":1223820987303,"author":"rs","revision":627,"repository_ssl_path":"https://svn.xp-dev.com/svn/rs-importable/","added":["/tags/logparser-1","/tags/logparser-1/src/python/reportgenerator.py"],"revision_web":"http://xp-dev.com/svnview/changeset/3/627/","repository":"rs-importable","repository_path":"http://svn.xp-dev.com/svn/rs-importable/","removed":[],"replaced":["/tags/logparser-1/src/sql","/tags/logparser-1/src","/tags/logparser-1/src/html","/tags/logparser-1/src/python","/tags/logparser-1/src/geoip"],"modified":[]}' http://example.com/webhook.php If you're using the example webhook listed above, you should the following output: bc.. object(stdClass)#1 (12) { ["message"]=> string(26) "svn:commit for logparser-1" ["timestamp"]=> float(1223820987300) ["author"]=> string(2) "rs" ["revision"]=> int(627) ["repository_ssl_path"]=> string(41) "https://svn.xp-dev.com/svn/rs-importable/" ["added"]=> array(2) { [0]=> string(17) "/tags/logparser-1" [1]=> string(47) "/tags/logparser-1/src/python/reportgenerator.py" } ["revision_web"]=> string(42) "http://xp-dev.com/svnview/changeset/3/627/" ["repository"]=> string(13) "rs-importable" ["repository_path"]=> string(40) "http://svn.xp-dev.com/svn/rs-importable/" ["removed"]=> array(0) { } ["replaced"]=> array(5) { [0]=> string(25) "/tags/logparser-1/src/sql" [1]=> string(21) "/tags/logparser-1/src" [2]=> string(26) "/tags/logparser-1/src/html" [3]=> string(28) "/tags/logparser-1/src/python" [4]=> string(27) "/tags/logparser-1/src/geoip" } ["modified"]=> array(0) { } }

rs picture

Text: h1. 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://svn.xp-dev.com/svn/rs-importable/", "added":["/trunk/pyserver/something"], "revision_web":"http://xp-dev.com/svnview/changeset/3/652/", "repository":"rs-importable", "repository_path":"http://svn.xp-dev.com/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)); ?> h3. Testing Your Webhook You can use "curl":http://curl.haxx.se/ to test your webhook. Head over to their "download page":http://curl.haxx.se/download.html and download the appropriate package for your platform. Running the following command will test that your webhook is installed correctly. Please do note that the webhook URL in the following example is set to *http://example.com/webhook.php*. You should change it to your own webhook URL. bc. curl -d '{"message":"svn:commit for logparser-1","timestamp":1223820987303,"author":"rs","revision":627,"repository_ssl_path":"https://svn.xp-dev.com/svn/rs-importable/","added":["/tags/logparser-1","/tags/logparser-1/src/python/reportgenerator.py"],"revision_web":"http://xp-dev.com/svnview/changeset/3/627/","repository":"rs-importable","repository_path":"http://svn.xp-dev.com/svn/rs-importable/","removed":[],"replaced":["/tags/logparser-1/src/sql","/tags/logparser-1/src","/tags/logparser-1/src/html","/tags/logparser-1/src/python","/tags/logparser-1/src/geoip"],"modified":[]}' http://example.com/webhook.php h1. XP-Dev.com Subversion Post Commit Webhooks "Webhooks":http://webhooks.pbwiki.com/ are a very useful feature for version control systems. {toc} 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://svn.xp-dev.com/svn/rs-importable/", "added":["/trunk/pyserver/something"], "revision_web":"http://xp-dev.com/svnview/changeset/3/652/", "repository":"rs-importable", "repository_path":"http://svn.xp-dev.com/svn/rs-importable/", "removed":["/trunk/pyserver/bootstrap/compile.py"], "replaced":[], "modified":["/trunk/pyserver/build.properties"] } h2. Example Code to Receive the Data PHP example: bc.. <?php $json = file_get_contents('php://input'); var_dump(json_decode($json)); ?> h2. Testing Your Webhook You can use "curl":http://curl.haxx.se/ to test your webhook. Head over to their "download page":http://curl.haxx.se/download.html and download the appropriate package for your platform. Running the following command will test that your webhook is installed correctly. Please do note that the webhook URL in the following example is set to *http://example.com/webhook.php*. You should change it to your own webhook URL. bc. curl -d '{"message":"svn:commit for logparser-1","timestamp":1223820987303,"author":"rs","revision":627,"repository_ssl_path":"https://svn.xp-dev.com/svn/rs-importable/","added":["/tags/logparser-1","/tags/logparser-1/src/python/reportgenerator.py"],"revision_web":"http://xp-dev.com/svnview/changeset/3/627/","repository":"rs-importable","repository_path":"http://svn.xp-dev.com/svn/rs-importable/","removed":[],"replaced":["/tags/logparser-1/src/sql","/tags/logparser-1/src","/tags/logparser-1/src/html","/tags/logparser-1/src/python","/tags/logparser-1/src/geoip"],"modified":[]}' http://example.com/webhook.php

rs picture

Text: h1. 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://svn.xp-dev.com/svn/rs-importable/", "added":["/trunk/pyserver/something"], "revision_web":"http://xp-dev.com/svnview/changeset/3/652/", "repository":"rs-importable", "repository_path":"http://svn.xp-dev.com/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)); ?> h3. Testing Your Webhook bc. curl -d '{"message":"svn:commit for logparser-1","timestamp":1223820987303,"author":"rs","revision":627,"repository_ssl_path":"https://svn.xp-dev.com/svn/rs-importable/","added":["/tags/logparser-1","/tags/logparser-1/src/python/reportgenerator.py"],"revision_web":"http://xp-dev.com/svnview/changeset/3/627/","repository":"rs-importable","repository_path":"http://svn.xp-dev.com/svn/rs-importable/","removed":[],"replaced":["/tags/logparser-1/src/sql","/tags/logparser-1/src","/tags/logparser-1/src/html","/tags/logparser-1/src/python","/tags/logparser-1/src/geoip"],"modified":[]}' http://blog-local/webhook.php h1. 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://svn.xp-dev.com/svn/rs-importable/", "added":["/trunk/pyserver/something"], "revision_web":"http://xp-dev.com/svnview/changeset/3/652/", "repository":"rs-importable", "repository_path":"http://svn.xp-dev.com/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)); ?> h3. Testing Your Webhook You can use "curl":http://curl.haxx.se/ to test your webhook. Head over to their "download page":http://curl.haxx.se/download.html and download the appropriate package for your platform. Running the following command will test that your webhook is installed correctly. Please do note that the webhook URL in the following example is set to *http://example.com/webhook.php*. You should change it to your own webhook URL. bc. curl -d '{"message":"svn:commit for logparser-1","timestamp":1223820987303,"author":"rs","revision":627,"repository_ssl_path":"https://svn.xp-dev.com/svn/rs-importable/","added":["/tags/logparser-1","/tags/logparser-1/src/python/reportgenerator.py"],"revision_web":"http://xp-dev.com/svnview/changeset/3/627/","repository":"rs-importable","repository_path":"http://svn.xp-dev.com/svn/rs-importable/","removed":[],"replaced":["/tags/logparser-1/src/sql","/tags/logparser-1/src","/tags/logparser-1/src/html","/tags/logparser-1/src/python","/tags/logparser-1/src/geoip"],"modified":[]}' http://example.com/webhook.php

rs picture

Text: h1. 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://svn.xp-dev.com/svn/rs-importable/", "added":["/trunk/pyserver/something"], "revision_web":"http://xp-dev.com/svnview/changeset/3/652/", "repository":"rs-importable", "repository_path":"http://svn.xp-dev.com/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)); ?>h1. 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://svn.xp-dev.com/svn/rs-importable/", "added":["/trunk/pyserver/something"], "revision_web":"http://xp-dev.com/svnview/changeset/3/652/", "repository":"rs-importable", "repository_path":"http://svn.xp-dev.com/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)); ?> h3. Testing Your Webhook bc. curl -d '{"message":"svn:commit for logparser-1","timestamp":1223820987303,"author":"rs","revision":627,"repository_ssl_path":"https://svn.xp-dev.com/svn/rs-importable/","added":["/tags/logparser-1","/tags/logparser-1/src/python/reportgenerator.py"],"revision_web":"http://xp-dev.com/svnview/changeset/3/627/","repository":"rs-importable","repository_path":"http://svn.xp-dev.com/svn/rs-importable/","removed":[],"replaced":["/tags/logparser-1/src/sql","/tags/logparser-1/src","/tags/logparser-1/src/html","/tags/logparser-1/src/python","/tags/logparser-1/src/geoip"],"modified":[]}' http://blog-local/webhook.php

12 years ago
rs picture
rs picture

Text: h1. 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://svn.xp-dev.com/svn/rs-importable/", "added":["/trunk/pyserver/something"], "revision_web":"http://xp-dev.com/svnview/changeset/3/652/", "repository":"rs-importable", "repository_path":"http://xp-dev.com/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)); ?>h1. 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://svn.xp-dev.com/svn/rs-importable/", "added":["/trunk/pyserver/something"], "revision_web":"http://xp-dev.com/svnview/changeset/3/652/", "repository":"rs-importable", "repository_path":"http://svn.xp-dev.com/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

View View full history