Receive an HTTP Post request and access it's contents for a parameterized build

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Receive an HTTP Post request and access it's contents for a parameterized build

Oli Spicer
I work in a .NET environment with Team Foundation Server on premises for version control.  I recently configured a Jenkins server to integrate test automation etc...

My aim is to trigger a Jenkins Build when my TFS Build has succeeded, which I have done.

My problem is this:  
  To trigger the Jenkins Build, I use a Team foundation Web-hook which essentially sends an HTTP Post request to the Jenkins REST API, launching the build.  
  The contents of the post request ( JSON ) contains information on the TFS build which I need, but I have yet to find a way to access the information and use it in Jenkins.
  
  Does anyone know of a solution to this problem ? To be able to read the contents of an HTTP request and use it in a build ?

  If not, then I plan on developing a plugin to make this possible.
  If anyone knows of a good place to get started on developing a plugin, any information would be much appreciated.

Thank you,

Oliver

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/61a381c0-0d4c-4164-a819-9afecf6c8055%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Receive an HTTP Post request and access it's contents for a parameterized build

Daniel Beck

> On 07.12.2016, at 14:15, Oli Spicer <[hidden email]> wrote:
>
>   If anyone knows of a good place to get started on developing a plugin, any information would be much appreciated.
>

https://wiki.jenkins-ci.org/display/JENKINS/Extend+Jenkins

I know it looks terrible, but there's a lot of documentation in there, just need to click a few more links than in better structured docs.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/244C6DB6-13D7-4585-A61C-33BCD62C2626%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Receive an HTTP Post request and access it's contents for a parameterized build

Oli Spicer
Thank you, no worries I'll work my way through it.

Le mercredi 7 décembre 2016 14:49:19 UTC+1, Daniel Beck a écrit :

> On 07.12.2016, at 14:15, Oli Spicer <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="PflyZPSkDAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">oli.s...@...> wrote:
>
>   If anyone knows of a good place to get started on developing a plugin, any information would be much appreciated.
>

<a href="https://wiki.jenkins-ci.org/display/JENKINS/Extend+Jenkins" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins-ci.org%2Fdisplay%2FJENKINS%2FExtend%2BJenkins\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHhAvbwkQnM1ePhYHuaeVOjLGezGA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins-ci.org%2Fdisplay%2FJENKINS%2FExtend%2BJenkins\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHhAvbwkQnM1ePhYHuaeVOjLGezGA&#39;;return true;">https://wiki.jenkins-ci.org/display/JENKINS/Extend+Jenkins

I know it looks terrible, but there's a lot of documentation in there, just need to click a few more links than in better structured docs.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/e196ab58-047d-424c-ba54-ef8294c0063a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Receive an HTTP Post request and access it's contents for a parameterized build

Mikel Sanchez Herrero
Hi Oli, did you get any information about your problem? i need the same as you

El miércoles, 7 de diciembre de 2016, 14:06:34 (UTC), Oli Spicer escribió:
Thank you, no worries I'll work my way through it.

Le mercredi 7 décembre 2016 14:49:19 UTC+1, Daniel Beck a écrit :

> On 07.12.2016, at 14:15, Oli Spicer <[hidden email]> wrote:
>
>   If anyone knows of a good place to get started on developing a plugin, any information would be much appreciated.
>

<a href="https://wiki.jenkins-ci.org/display/JENKINS/Extend+Jenkins" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins-ci.org%2Fdisplay%2FJENKINS%2FExtend%2BJenkins\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHhAvbwkQnM1ePhYHuaeVOjLGezGA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins-ci.org%2Fdisplay%2FJENKINS%2FExtend%2BJenkins\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHhAvbwkQnM1ePhYHuaeVOjLGezGA&#39;;return true;">https://wiki.jenkins-ci.org/display/JENKINS/Extend+Jenkins

I know it looks terrible, but there's a lot of documentation in there, just need to click a few more links than in better structured docs.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/f552ea80-8905-4346-bc76-fc85a1afd3fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Receive an HTTP Post request and access it's contents for a parameterized build

Tomas Bjerre
In reply to this post by Oli Spicer
You can read the JSON with this plugin:

  https://wiki.jenkins.io/display/JENKINS/Generic+Webhook+Trigger+Plugin


Den onsdag 7 december 2016 kl. 14:15:12 UTC+1 skrev Oli Spicer:
I work in a .NET environment with Team Foundation Server on premises for version control.  I recently configured a Jenkins server to integrate test automation etc...

My aim is to trigger a Jenkins Build when my TFS Build has succeeded, which I have done.

My problem is this:  
  To trigger the Jenkins Build, I use a Team foundation Web-hook which essentially sends an HTTP Post request to the Jenkins REST API, launching the build.  
  The contents of the post request ( JSON ) contains information on the TFS build which I need, but I have yet to find a way to access the information and use it in Jenkins.
  
  Does anyone know of a solution to this problem ? To be able to read the contents of an HTTP request and use it in a build ?

  If not, then I plan on developing a plugin to make this possible.
  If anyone knows of a good place to get started on developing a plugin, any information would be much appreciated.

Thank you,

Oliver

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/8f1df500-23f9-4018-8ac9-2665df7a8d0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Receive an HTTP Post request and access it's contents for a parameterized build

Oli Spicer
In reply to this post by Mikel Sanchez Herrero
In the end I had to develop my own plugin. Unfortunately I cannot share it, but the plugin Tomas Bjerre developed seems to be what you are looking for.

If not, this is roughly what I did in my plugin:
- Extended the Jenkins API to add an endpoint.
- Made a "Web Method" that would receive the Team Foundation Server's request
- Browse through the request's content to find the data I was looking for
- Launch an HTTP request of my own to start the Jenkins Job 

I hope you manage to resolve your problem. If not I'm happy to help.

Le lundi 2 octobre 2017 16:59:01 UTC+2, Mikel Sanchez Herrero a écrit :
Hi Oli, did you get any information about your problem? i need the same as you

El miércoles, 7 de diciembre de 2016, 14:06:34 (UTC), Oli Spicer escribió:
Thank you, no worries I'll work my way through it.

Le mercredi 7 décembre 2016 14:49:19 UTC+1, Daniel Beck a écrit :

> On 07.12.2016, at 14:15, Oli Spicer <[hidden email]> wrote:
>
>   If anyone knows of a good place to get started on developing a plugin, any information would be much appreciated.
>

<a href="https://wiki.jenkins-ci.org/display/JENKINS/Extend+Jenkins" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins-ci.org%2Fdisplay%2FJENKINS%2FExtend%2BJenkins\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHhAvbwkQnM1ePhYHuaeVOjLGezGA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.jenkins-ci.org%2Fdisplay%2FJENKINS%2FExtend%2BJenkins\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHhAvbwkQnM1ePhYHuaeVOjLGezGA&#39;;return true;">https://wiki.jenkins-ci.org/display/JENKINS/Extend+Jenkins

I know it looks terrible, but there's a lot of documentation in there, just need to click a few more links than in better structured docs.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/4d6eeb2b-a775-43ff-a1c8-19bebf54f22e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.