tag:help.appveyor.com,2012-11-13:/discussions/questions/939-how-should-the-svn-webhook-be-called-and-with-what-parameters-to-trigger-a-buildAppVeyor: Discussion 2018-08-25T01:53:57Ztag:help.appveyor.com,2012-11-13:Comment/359534532015-02-03T22:46:35Z2015-02-03T22:46:35ZHow should the SVN webhook be called and with what parameters to trigger a build<div><p>In general, it expects <code>POST</code> with the following
<code>application/json</code> payload: <a href=
"https://gist.github.com/FeodorFitsner/575d8dd7722cf44908c5">https://gist.github.com/FeodorFitsner/575d8dd7722cf44908c5</a></p>
<p>But I'm not sure if Assembla sends in this format. If they allow
<code>post receive</code> server-side hooks you can build a script
to push such payload. We have sample hooks for both Git and
Mercurial, but not for Subversion: <a href=
"https://github.com/appveyor/webhooks">https://github.com/appveyor/webhooks</a></p>
<p>Alternatively, you can just call webhook with POST and empty
payload to trigger build of last commit.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/359534532015-02-03T22:58:05Z2015-02-03T22:58:05ZHow should the SVN webhook be called and with what parameters to trigger a build<div><p>I tried calling the webhook with an empty post request and the
result is a 500 error:</p>
<p>POST <a href=
"https://ci.appveyor.com/api/subversion/webhook?id=mywebhook">https://ci.appveyor.com/api/subversion/webhook?id=mywebhook</a>
HTTP/1.1</p>
<p>User-Agent: Fiddler</p>
<p>Host: ci.appveyor.com</p>
<p>Content-Length: 0</p>
<p>HTTP/1.1 500 Internal Server Error</p>
<p>Cache-Control: no-cache</p>
<p>Pragma: no-cache</p>
<p>Content-Type: application/json; charset=utf-8</p>
<p>Expires: -1</p>
<p>Server: Microsoft-IIS/8.5</p>
<p>X-AspNet-Version: 4.0.30319</p>
<p>X-Powered-By: ASP.NET</p>
<p>Date: Tue, 03 Feb 2015 22:48:09 GMT</p>
<p>Content-Length: 67</p>
<p>{<a href=""Object">message</a> reference not set to an
instance of an object."}</p>
<p>I also tried with payload specified in your Github post and got
a 500 error as well.</p></div>mmillertag:help.appveyor.com,2012-11-13:Comment/359534532015-02-03T23:03:46Z2015-02-03T23:03:46ZHow should the SVN webhook be called and with what parameters to trigger a build<div><p>Remove <code>Content-type: application/json</code> when sending
empty POST request.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/359534532015-02-03T23:05:30Z2015-02-03T23:05:30ZHow should the SVN webhook be called and with what parameters to trigger a build<div><p>In the second case it gives error because YAML in "config" field
is invalid. Try sending this one:</p>
<pre>
<code>{
"commit": {
"id":"5",
"author":{
"name":"Author Name",
"email":"author@email.com"
},
"timestamp":"2015-01-15T21:08:38-08:00",
"message":"commit message"
},
"repository":{
"name":"repo_name",
"url":"repo_url"
},
"config":null
}</code>
</pre></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/359534532015-02-03T23:17:12Z2015-02-03T23:17:12ZHow should the SVN webhook be called and with what parameters to trigger a build<div><p>I am not including a content type header – the raw request
/ response is below:</p>
<p>POST <a href=
"https://ci.appveyor.com/api/subversion/webhook?id=lqrs7ig1bau940an">
https://ci.appveyor.com/api/subversion/webhook?id=lqrs7ig1bau940an</a>
HTTP/1.1</p>
<p>Host: ci.appveyor.com</p>
<p>Content-Length: 0</p>
<p>--RESPONSE--</p>
<p>HTTP/1.1 500 Internal Server Error</p>
<p>Cache-Control: no-cache</p>
<p>Pragma: no-cache</p>
<p>Content-Type: application/json; charset=utf-8</p>
<p>Expires: -1</p>
<p>Server: Microsoft-IIS/8.5</p>
<p>X-AspNet-Version: 4.0.30319</p>
<p>X-Powered-By: ASP.NET</p>
<p>Date: Tue, 03 Feb 2015 23:15:27 GMT</p>
<p>Content-Length: 67</p>
<p>{<a href=""Build">message":"Object reference not set to an
instance of an object."}</a></p>
<p><a href=""Build">I tried it with the JSON content you
included – raw request / response below:</a></p>
<p><a href=""Build">POST
https://ci.appveyor.com/api/subversion/webhook?id=myid
HTTP/1.1</a></p>
<p><a href=""Build">Host: ci.appveyor.com</a></p>
<p><a href=""Build">Content-Length: 322</a></p>
<p><a href=""Build">Content-type: application/json</a></p>
<p><a href=""Build">{</a></p>
<p><a href=""Build">"commit": {</a></p>
<pre>
<a href=""Build"><code> "id":"5",
"author":{
"name":"Author Name",
"email":"author@email.com"
},
"timestamp":"2015-01-15T21:08:38-08:00",
"message":"commit message"</code></a>
</pre>
<p><a href=""Build">},</a></p>
<p><a href=""Build">"repository":{</a></p>
<pre>
<a href=""Build"><code> "name":"repo_name",
"url":"repo_url"</code></a>
</pre>
<p><a href=""Build">},</a></p>
<p><a href=""Build">"config":null</a></p>
<p><a href=""Build">}</a></p>
<p><a href=""Build">-- RESPONSE --</a></p>
<p><a href=""Build">HTTP/1.1 500 Internal Server Error</a></p>
<p><a href=""Build">Cache-Control: no-cache</a></p>
<p><a href=""Build">Pragma: no-cache</a></p>
<p><a href=""Build">Content-Type: application/json;
charset=utf-8</a></p>
<p><a href=""Build">Expires: -1</a></p>
<p><a href=""Build">Server: Microsoft-IIS/8.5</a></p>
<p><a href=""Build">X-AspNet-Version: 4.0.30319</a></p>
<p><a href=""Build">X-Powered-By: ASP.NET</a></p>
<p><a href=""Build">Date: Tue, 03 Feb 2015 23:14:23
GMT</a></p>
<p><a href=""Build">Content-Length: 49</a></p>
<p><a href=""Build">{"message":"Build version 1.0.6 already
exists."}</a></p>
<p><a href=""Build">I tried it with no content and content
type header and the got the same thing:</a></p>
<p><a href=""Build">POST
https://ci.appveyor.com/api/subversion/webhook?id=myid
HTTP/1.1</a></p>
<p><a href=""Build">Host: ci.appveyor.com</a></p>
<p><a href=""Build">Content-Length: 2</a></p>
<p><a href=""Build">Content-type: application/json</a></p>
<p><a href=""Build">{}</a></p>
<p><a href=""Build">-- RESPONSE --</a></p>
<p><a href=""Build">HTTP/1.1 500 Internal Server Error</a></p>
<p><a href=""Build">Cache-Control: no-cache</a></p>
<p><a href=""Build">Pragma: no-cache</a></p>
<p><a href=""Build">Content-Type: application/json;
charset=utf-8</a></p>
<p><a href=""Build">Expires: -1</a></p>
<p><a href=""Build">Server: Microsoft-IIS/8.5</a></p>
<p><a href=""Build">X-AspNet-Version: 4.0.30319</a></p>
<p><a href=""Build">X-Powered-By: ASP.NET</a></p>
<p><a href=""Build">Date: Tue, 03 Feb 2015 23:12:53
GMT</a></p>
<p><a href=""Build">Content-Length: 49</a></p>
<p><a href=""Build">{"message</a> version 1.0.6 already
exists."}</p>
<p>Thanks for all the help and quick responses.</p></div>mmillertag:help.appveyor.com,2012-11-13:Comment/359534532015-02-03T23:18:34Z2015-02-03T23:18:34ZHow should the SVN webhook be called and with what parameters to trigger a build<div><p>Actually I think something else is wrong because I get the same
error message when I try to build thru the console:</p>
<p>Build version 1.0.6 already exists.</p></div>mmillertag:help.appveyor.com,2012-11-13:Comment/359534532015-02-03T23:20:05Z2015-02-03T23:20:05ZHow should the SVN webhook be called and with what parameters to trigger a build<div><p>Actually I see what happened – I saved the configuration
during the middle of build. I think including the content type
header and an empty json body works to trigger the build.</p></div>mmillertag:help.appveyor.com,2012-11-13:Comment/359534532015-02-03T23:21:02Z2015-02-03T23:21:02ZHow should the SVN webhook be called and with what parameters to trigger a build<div><p>Right. Open "General" tab of project setting and increment build
number.</p>
<p>Must be racing condition glitch - will be working to fix
that.</p></div>Feodor Fitsner