Re: workflow plugin -- dynamically select specifc slave nodes in for loop

2015-07-14 Thread Owen B. Mehegan
Oh, thanks! I had seen that example code before but misunderstood what it was doing. Now it makes sense, and I have it working. On Monday, July 13, 2015 at 5:24:18 PM UTC-7, Anshu Arya wrote: > > Whoops, this is the code: > def parTask = [:] > > for(int i = 0; i < all_nodes.size(); i++) { >de

Re: workflow plugin -- dynamically select specifc slave nodes in for loop

2015-07-13 Thread Anshu Arya
Whoops, this is the code: def parTask = [:] for(int i = 0; i < all_nodes.size(); i++) { def node_name = all_nodes[i] parTask[node_name] = { node(node_name) {/* stuff to do in parallel across selected nodes */ } } } parallel parTask On Monday, July 13, 2015 at 5:19:57 PM UTC-7, Ans

Re: workflow plugin -- dynamically select specifc slave nodes in for loop

2015-07-13 Thread Anshu Arya
The workaround right now is to just use normal C-style loops. For example if you want to do stuff in parallel: def parTask = [:] for(int i = 0; i < all_nodes.size(); i++) { def node_name = all_nodes[i] parTask[node_name] = { /* stuff to do in parallel */ } } parallel parTask On Monday,

Re: workflow plugin -- dynamically select specifc slave nodes in for loop

2015-07-13 Thread Owen B. Mehegan
I'm trying to accomplish basically the same thing - I have identical steps that I want to run on >1 slave, in parallel. Is there any other succinct way to write this? Right now I am duplicating everything for each slave, which should offend anyone's sense of programming decency :) Being able to

Re: workflow plugin -- dynamically select specifc slave nodes in for loop

2015-06-16 Thread Jesse Glick
On Monday, April 27, 2015 at 11:18:09 PM UTC-4, Anshu Arya wrote: > > java.io.NotSerializableException: java.util.AbstractList$Itr > JENKINS-27421 -- You received this message because you are subscribed to the Google Groups "Jenkins Users" g

Re: workflow plugin -- dynamically select specifc slave nodes in for loop

2015-04-27 Thread Anshu Arya
More info: echo TEST_MACHINES def all_nodes = TEST_MACHINE.split(',') for (node_name in all_nodes) { echo 'Plan to run on ' + node_name } for (node_name in all_nodes) { node(node_name) { echo 'My name is ' + node_name } } Results in: Running: Print Message A10-4600M,A10-5

Re: workflow plugin -- dynamically select specifc slave nodes in for loop

2015-04-27 Thread Anshu Arya
Yes, it executes on the first node, but the remaining nodes do not respond and the job fails at that point. On Thursday, April 23, 2015 at 9:38:25 PM UTC-7, Baptiste Mathus wrote: > > What do you mean it fails? You mean it only does it on the first node? > Might be known issue, IIRC. There's bee

Re: workflow plugin -- dynamically select specifc slave nodes in for loop

2015-04-23 Thread Baptiste Mathus
What do you mean it fails? You mean it only does it on the first node? Might be known issue, IIRC. There's been report in the past that someList.forEach() would only process the fist element. That sounds related. 2015-04-10 18:34 GMT+02:00 Anshu Arya : > I want to use a list of nodes to launch a

[workflow-plugin] -- dynamically select specifc slave nodes in for loop

2015-04-10 Thread Anshu Arya
I want to use a list of nodes to launch a command on specific nodes, so I tried this: for (node_name in all_nodes) { node(node_name) { echo 'My name is ' + node_name } } This works for the first node in "all_nodes" but then fails after that. Is there a better way to do this? -