How should the SVN webhook be called and with what parameters to trigger a build
I am trying to call the SVN webhook from Assembla to trigger a build on commit. How should it be called? I can't find any documentation on this.
Http Method - Should it be GET or POST (or something else)
Content Type - application/xml or application/json?
Content - what needs to be in the body to trigger the build
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Feodor Fitsner on 03 Feb, 2015 10:46 PM
In general, it expects
POST
with the followingapplication/json
payload: https://gist.github.com/FeodorFitsner/575d8dd7722cf44908c5But I'm not sure if Assembla sends in this format. If they allow
post receive
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: https://github.com/appveyor/webhooksAlternatively, you can just call webhook with POST and empty payload to trigger build of last commit.
2 Posted by mmiller on 03 Feb, 2015 10:58 PM
I tried calling the webhook with an empty post request and the result is a 500 error:
POST https://ci.appveyor.com/api/subversion/webhook?id=mywebhook HTTP/1.1
User-Agent: Fiddler
Host: ci.appveyor.com
Content-Length: 0
HTTP/1.1 500 Internal Server Error
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 03 Feb 2015 22:48:09 GMT
Content-Length: 67
{"message":"Object reference not set to an instance of an object."}
I also tried with payload specified in your Github post and got a 500 error as well.
Support Staff 3 Posted by Feodor Fitsner on 03 Feb, 2015 11:03 PM
Remove
Content-type: application/json
when sending empty POST request.Support Staff 4 Posted by Feodor Fitsner on 03 Feb, 2015 11:05 PM
In the second case it gives error because YAML in "config" field is invalid. Try sending this one:
5 Posted by mmiller on 03 Feb, 2015 11:17 PM
I am not including a content type header – the raw request / response is below:
POST https://ci.appveyor.com/api/subversion/webhook?id=lqrs7ig1bau940an HTTP/1.1
Host: ci.appveyor.com
Content-Length: 0
--RESPONSE--
HTTP/1.1 500 Internal Server Error
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 03 Feb 2015 23:15:27 GMT
Content-Length: 67
{"message":"Object reference not set to an instance of an object."}
I tried it with the JSON content you included – raw request / response below:
POST https://ci.appveyor.com/api/subversion/webhook?id=myid HTTP/1.1
Host: ci.appveyor.com
Content-Length: 322
Content-type: application/json
{
"commit": {
"id":"5",
"author":{
"name":"Author Name",
"email":"[email blocked]"
},
"timestamp":"2015-01-15T21:08:38-08:00",
"message":"commit message"
},
"repository":{
"name":"repo_name",
"url":"repo_url"
},
"config":null
}
-- RESPONSE --
HTTP/1.1 500 Internal Server Error
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 03 Feb 2015 23:14:23 GMT
Content-Length: 49
{"message":"Build version 1.0.6 already exists."}
I tried it with no content and content type header and the got the same thing:
POST https://ci.appveyor.com/api/subversion/webhook?id=myid HTTP/1.1
Host: ci.appveyor.com
Content-Length: 2
Content-type: application/json
{}
-- RESPONSE --
HTTP/1.1 500 Internal Server Error
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 03 Feb 2015 23:12:53 GMT
Content-Length: 49
{"message":"Build version 1.0.6 already exists."}
Thanks for all the help and quick responses.
6 Posted by mmiller on 03 Feb, 2015 11:18 PM
Actually I think something else is wrong because I get the same error message when I try to build thru the console:
Build version 1.0.6 already exists.
7 Posted by mmiller on 03 Feb, 2015 11:20 PM
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.
Support Staff 8 Posted by Feodor Fitsner on 03 Feb, 2015 11:21 PM
Right. Open "General" tab of project setting and increment build number.
Must be racing condition glitch - will be working to fix that.
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:53 AM.