I know this "thread" is old, but in case someone has the same problem with creating nodes via a script here is my solution (that considering how easy it is in the end took me an awfully lot of time to figure out):
Jenkins-CLI has an option to run groovy scripts: java -jar path/to/jenkins-cli.jar -s http://localhost:8080 groovy path/to/script script: import jenkins.model.* import hudson.model.* import hudson.slaves.* Jenkins.instance.addNode(new DumbSlave("test-script","test slave description","C:\\Jenkins","1",Node.Mode.NORMAL,"test-slave-label",new JNLPLauncher(),new RetentionStrategy.Always(),new LinkedList())) (see docs for other options: http://javadoc.jenkins-ci.org/) You can also run an interactive groovy shell with java -jar jenkins-cli.jar -s http://localhost:8080 groovysh But any attempts to "feed" it a single command were unsuccessful in my case. Dňa pondelok, 16. januára 2012 15:20:45 UTC+1 grayaii napísal(-a): > > You can read my post here: > > http://jenkins.361315.n4.nabble.com/Event-Trigger-when-job-gets-put-on-queue-td4021230.html#a4024248 > comment > > Like you, I'm creating slaves via the Swarm Plugin. It works pretty good > and so far I've had no issues using it. > > > -- > View this message in context: > http://jenkins.361315.n4.nabble.com/API-to-create-manage-nodes-tp4274306p4299622.html > Sent from the Jenkins users mailing list archive at Nabble.com. > > -- 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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
