Yeah I figured it would be the case, but wanted to check just in case.  I 
ended up writing a proxy that will translate Gitlab webhook requests and 
send the JSON as a "payload" parameter to another url specified by a url 
param (which would be Jenkins job trigger).  It will also send a few other 
parameters as that can be used as Jenkins parameters without having to 
parse the JSON. 

Code is here in case anyone else runs into this issue:

https://github.com/akira/githookproxy

Thanks, 

Alex Kira


On Thursday, September 19, 2013 11:35:09 AM UTC-7, JonathanRRogers wrote:
>
>
>
> On Wednesday, September 18, 2013 5:46:15 PM UTC-4, Alex Kira wrote:
>>
>> Hi, 
>>
>> Is there a way to read the request body from a triggered job?  I am 
>> trying to integrate with another service that posts the request parameters 
>> as JSON in the raw body.  
>>
>> This is a curl request that generates a similar request:
>>
>> curl -X POST -H "Content-Type: application/json" -d 
>> '{"commits":"xyz","payload":"xyz"}' 
>> http://jenkins-url.com/job/Test/buildWithParameters
>>
>> Is there a way to access the posted JSON in my build scripts?  (Note that 
>> I cannot change the format of the request or how the JSON is passed).
>>
>
>
> This sounds like it would require significant Jenkins extension since you 
> want to teach it another API. I would probably be more inclined to write a 
> proxy service which translates from the API of your other service to that 
> of Jenkins. I'm not sure what you're used to, but I've done something 
> similar with a page or two of Python. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to