Jenkins node selection

91 views
Skip to first unread message

Tejinder Kaur Gill

unread,
Feb 7, 2017, 3:36:59 PM2/7/17
to Jenkins Users
How can we specify the node on which Jenkins multibranch pipeline job will run,by default it run on master nd creating space issue on master ,need to configure on some slave .

David Karr

unread,
Feb 7, 2017, 3:50:43 PM2/7/17
to Jenkins Users
On Tuesday, February 7, 2017 at 12:36:59 PM UTC-8, Tejinder Kaur Gill wrote:
How can we specify the node on which Jenkins multibranch pipeline job will run,by default it run on master nd creating space issue on master ,need to configure on some slave .

I'm frankly not certain about multibranch vs. "plain" pipeline, but in an ordinary pipeline script, you can pass a "label" to the node function, so instead of this:
node {
   
...
}

 You can do (for instance):
node("docker") {
 
...
}

By default, this will reference a node with that name, but you really should add "labels" to your slave definitions, expressing the kinds of functionality that slave can handle.  If there's one particular slave that should be used for docker builds, then put that label value on it.

Kristian

unread,
Feb 8, 2017, 9:48:12 AM2/8/17
to jenkins...@googlegroups.com
This also works in a multibranch pipeline job. Just do it like David wrote:

*****
node("some_slave_label") {
...
}
*****
> --
> 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/5903e94d-5a48-4fea-b812-d0197bd60ef8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages