Hi,

I wrote a plugin (not battle-tested but well test-covered) that may be
helpful for Jeff's requirements.

You can see the code here:
https://github.com/jenkinsci/fedora-module-build-system-plugin

This step:
https://github.com/jenkinsci/fedora-module-build-system-plugin/blob/master/src/main/java/com/redhat/fedora/buildsystem/mbs/pipeline/SubmitModuleBuildRequestStep.java,
is the one that makes a REST api call

I then have an example here of how to call it:
https://github.com/jenkinsci/fedora-module-build-system-plugin/blob/master/src/test/resources/com/redhat/fedora/buildsystem/mbs/simpleSubmit.groovy

and a more complete example that includes a timeout and waitUntil here:
https://github.com/jenkinsci/fedora-module-build-system-plugin/blob/master/src/test/resources/com/redhat/fedora/buildsystem/mbs/complete.groovy

Hope that helps.

Scott


On Mon, Apr 9, 2018 at 9:26 AM, Jesse Glick <[email protected]> wrote:

> On Sun, Apr 8, 2018 at 12:06 PM, Jeff Wilson <[email protected]>
> wrote:
> > I have a long running build action
> > that involves sending commands to a REST API, getting the results,
> parsing
> > them and writing out artifacts that could be used by a later build step.
>
> Most similar functions use `SynchronousNonBlockingStepExecution` and
> abort on Jenkins restart under the guess that the time window here is
> pretty small and a restart in the middle is unlikely. Perhaps you can
> do better if you want to put in the effort, but I am not sure how—if
> you are making a REST call from the Jenkins JVM, then a restart will
> of course break that TCP connection.
>
> Simpler options:
>
> · Use `SynchronousNonBlockingStepExecution` but have users wrap the
> step in `retry` if they care enough about a single build passing. (I
> have not personally tested the combination.)
> · Do not bother with a step at all, or a Jenkins plugin for that
> matter. Write a little Python program or whatever that does the same
> thing and have people call it via `sh`/`bat`. Kills a whole flock of
> birds with one little stone.
>
> --
> 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 [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jenkinsci-dev/CANfRfr2L82Yi4SZ2zQ_mE%2BJ05ZMocgX7gERA9MEYRyQL1_
> b6Qg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CALtL2uG%3D0x2OJcOg-RO4CTK4b-WAJy-C0BTLyW4LF6kxo0nUHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to