Re: [workflow] can a Step create child Steps?

2015-07-27 Thread Jesse Glick
On Fri, Jul 24, 2015 at 12:00 PM, James Strachan
james.strac...@gmail.com wrote:
 I wonder has anyone ever tried such a thing; written a Step which creates
 one or more child steps itself?

There is no API which would permit a `StepExecution` to create and run
another one.

What you *can* do is to create a `Step` which does just the Hubot
notification itself, then create a higher-level DSL that calls it
together with `input` in a recommended way. `docker-workflow` does
something like this.

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr3veiKro%3DHjxypQYLgt8JwXZiwR-qpqMvOuMrO4xKW-Vw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[workflow] can a Step create child Steps?

2015-07-24 Thread James Strachan
I've dipped my toe into the world of writing Jenkins Workflow Steps; so far 
so good!

I've written a little hubot chat bot approval step as a kinda 
facade/decorator of InputStep:
https://github.com/fabric8io/fabric8-jenkins-workflow-steps#hubotapprove

whats a bit smelly though is that the hubotApprove should really configure 
and execute an `input` step internally
https://github.com/fabric8io/fabric8-jenkins-workflow-steps/issues/1

right now I've been writing a redundant 2nd line in the workflow groovy 
files:

hubotApprove Do you want to stage?
 input id: 'Proceed', message: Do you want to stage?


When really the HubotApproveStep should be creating the InputStep / 
InputStepExecution internally so the user just needs to do:

hubotApprove Do you want to stage?

 
I wonder has anyone ever tried such a thing; written a Step which creates 
one or more child steps itself? I wasn't sure how the DI stuff worked for 
that kinda thing and so far my googling / searching hasn't found an 
example. 

Anyone got any hints please?

Many thanks!

James

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/46f5ec29-11ef-404d-97a6-2f256f055062%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.