My Jenkins pipeline randomly alternates between running on master and on agent (slave) machines.
The whole pipeline has only one agent statement, thus:
pipeline {
agent any
How can I get the build to run in load-balanced agents, and never master?
Maybe it could be done with
agent { label 'some-label' }. Is there a predefined label that specifies agents and not master? Or do I have to label all agents myself?This and this show how to choose a specific agent, but I want random balancing between agent machines.
- This question discusses
agent anyvsagent none, but neither of those blocks the master from being used. - This page recommends wrapping everything in a
nodestanza, but that seems to force the build to run on master or a specified node, which again does not allow balancing of agents.