Hi,

you could create a function take a clojure in parameter and use it. For
example:

def myenvironment(def body) {
  def label = configure()
  node(label) {
    body.call()
  }
}

and use it like

myenvironment {
  sh "make"
}

Le mar. 2 août 2016 à 14:51, Ioannis Canellos <[email protected]> a écrit :

> Hi all,
>
> I have a couple of pipeline steps that I want to have the combined as one.
> For example I have the 'configure' step which returns a label and I want
> to combine it with the node step as follows:
>
> label = configure()
> node(label) {
> ...
> }
>
> So, what I want is to create an alternative of node, that encapsulates the
> above.
> Any hints on where I should look?
>
> --
> 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/4d77a7a6-1f1a-43b9-82f1-a73e5147f56b%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/4d77a7a6-1f1a-43b9-82f1-a73e5147f56b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CAKwJSvxOybDVs5tWpN7p%2Bo%3DR4kKnkkc7-08iAdUovtsrnFXTUg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to