Develop a custom step that would make pipeline wait for a webhook

55 views
Skip to first unread message

Julien HENRY

unread,
Nov 25, 2016, 4:14:40 AM11/25/16
to Jenkins Developers, Fabrice Bellingard
Hi guys,

We would like to implement a feature in the SonarQube plugin that would make the pipeline wait for some external/asynchronous processing to be completed (SonarQube analysis). In addition we would like to get some data (JSON payload) from this external process. Something like:

def analysisResult;
withSonarQubeEnv('mySonar') {
    sh 'mvn sonar:sonar' // Submit asynchronous analysis
    analysisResult = waitForSonarQubeAnalysis 
} if (analysisResult.isSuccess) {
promote() } else { notifyKO(analysisResult)
}

I found this ticket https://issues.jenkins-ci.org/browse/JENKINS-27127 that is really close to what we need. Is there any progress on that topic? Waiting for this generic step, do you think it would be possible to implement the feature with a custom step?

Thanks

Julien

Jesse Glick

unread,
Nov 28, 2016, 6:51:53 PM11/28/16
to Jenkins Dev
On Fri, Nov 25, 2016 at 4:14 AM, Julien HENRY
<julien...@sonarsource.com> wrote:
> I found this ticket https://issues.jenkins-ci.org/browse/JENKINS-27127 that
> is really close to what we need.

Yes, sounds like it. The issue needs to be “defuzzed” somewhat:
concrete proposals written up, possibly broken into multiple features.

> Is there any progress on that topic?

Not currently.

> Waiting for this generic step, do you think it would be possible to
> implement the feature with a custom step?

Sure, there is nothing stopping you from writing a limited version of
this feature tailored to your needs.

https://github.com/jenkinsci/workflow-step-api-plugin/#creating-an-asynchronous-step

plus probably an `UnprotectedRootAction` (take care to consider
malicious payloads).

Julien HENRY

unread,
Nov 30, 2016, 9:30:57 AM11/30/16
to jenkin...@googlegroups.com
Hi Jesse,

Thanks for the pointers.


--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/C3rixeHrSrY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr0eoqDrV_sMtvN7XR3aPExECjwki4Ckzqg8O93HLKL08A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages