As per the title, in Jenkins how can I add new slave nodes to my build cluster using the CLI, or if there is not a CLI option, is there another scriptable approche that can be used?
There are two ways of authentication for setting up the Linux Jenkins slave agents.
Basic CLI instruction can be found here.
The following CLI command should get the new node configuration XML as stdin:
java -jar jenkins-cli.jar -s [JENKINS_URL] create-node [NewNodeName]
For example, if you want to copy an existing node, you can use:
java -jar jenkins-cli.jar -s [JENKINS_URL] get-node [NodeToCopyFrom] | java -jar jenkins-cli.jar -s [JENKINS_URL] create-node [NewNodeName]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With