And how do I wrap a snippet like this inside a jenkins plugin?

On Tuesday, August 2, 2016 at 4:01:26 PM UTC+3, Baptiste Mathus wrote:
>
> Live example:
>
> https://github.com/jenkinsci/jenkins/blob/master/Jenkinsfile#L184L190
>
> Cheers
>
> Le 2 août 2016 2:56 PM, "Adrien Lecharpentier" <[email protected] 
> <javascript:>> 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] 
>> <javascript:>> 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] <javascript:>.
>>> 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] <javascript:>.
>> 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/36cbfb28-c795-4054-82d8-54218bf10c04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to