Can you specify a host / agent for a single build step in a freestyle project?

22 views
Skip to first unread message

Adam von Nieda

unread,
Dec 6, 2018, 5:06:50 PM12/6/18
to jenkins...@googlegroups.com

Hi folks,

I’m able to split parts of a build across multiple nodes using a pipeline, is there any way to do that with a freestyle project? Maybe a plugin I haven’t run across?

For example, my project might look like the following..

Step1: Execute on node 2
Step 2: Execute on node 3
Step 3: Execute on node 1
Step 4: Execute on node 2

I have steps that have to run on specific nodes.

Thanks for any insight you might have!

-Adam vonNieda

Jan Monterrubio

unread,
Dec 6, 2018, 6:22:53 PM12/6/18
to jenkins...@googlegroups.com
I think a declarative pipeline might be able to accomplish this with the “agent” closure. 

Iirc the free style project will run all in a single node. 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/A6478625-CB00-49F8-9602-DE745B034D3E%40vonnieda.org.
For more options, visit https://groups.google.com/d/optout.

Adam von Nieda

unread,
Dec 6, 2018, 6:52:18 PM12/6/18
to jenkins...@googlegroups.com

  Thanks very much for the reply Jan, I’m aware of being able to do this with a pipeline. I’ll ask again in case anyone else wants to respond. By the way, a freestyle project is not necessarily isolated to a single node, you can specify labels or individual servers using the NodeLabel plugin. That’s different from what I’m asking below though.  


I’m able to split parts of a build across multiple nodes using a pipeline, is there any way to do that with a freestyle project? Maybe a plugin I haven’t run across? 

For example, my project might look like the following..

Step1: Execute on node 2
Step 2: Execute on node 3
Step 3: Execute on node 1
Step 4: Execute on node 2

  I have steps that have to run on specific nodes. 

  Thanks for any insight you might have!

--
Adam vonNieda




Eric Pyle

unread,
Dec 7, 2018, 9:12:51 AM12/7/18
to jenkins...@googlegroups.com, Adam von Nieda
This isn't exactly what you asked, but you could:
1. Break up each step into its own freestyle job, and give each of those sub-jobs a parameter of type Node or Label.
2. In the main job, call each sub-job using the build step "Trigger/call builds on other projects", passing the desired agent as a parameter. You could also pass "Current build parameters" or environment variables to give the build step what it needs.

-Eric

For more options, visit https://groups.google.com/d/optout.

-- 
Eric Pyle
Siemens PLM Software
Lebanon, NH
+1 603-277-3060
eric...@siemens.com
http://www.siemens.com/plm

Adam von Nieda

unread,
Dec 7, 2018, 9:27:27 AM12/7/18
to jenkins...@googlegroups.com

   Thanks for the reply Eric, yeah that’s a workaround I could try. I was hoping there was some plugin that I hadn’t been able to find that made it simple, but I guess not. 

   Best regards,

      -Adam 

--
Adam vonNieda



Reply all
Reply to author
Forward
0 new messages