Live example: https://github.com/jenkinsci/jenkins/blob/master/Jenkinsfile#L184L190
Cheers Le 2 août 2016 2:56 PM, "Adrien Lecharpentier" < [email protected]> a écrit : > 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 > <https://groups.google.com/d/msgid/jenkinsci-dev/CAKwJSvxOybDVs5tWpN7p%2Bo%3DR4kKnkkc7-08iAdUovtsrnFXTUg%40mail.gmail.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/CANWgJS4k4aF6rV4MDhSPtvU0G9DFnGShJWs9ooB65pmMw%3DQz_g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
