Thanks for your comments, guys, I have found a solution that combines the creation of slave and an agent launch.
Just in case someone needs it.
1. Have an XML jnlp_slave.xml with slave description containing executor thread count and labels, e.g.
<slave>
<remoteFS>/opt/jenkins2</remoteFS>
<numExecutors>2</numExecutors>
<launcher class="hudson.slaves.JNLPLauncher" />
<label>fat</label>
</slave>
2. Run the following script to start agent (considering that
http://jenkins:8080/jenkins/ is a Jenkins main page):
wget
http://jenkins:8080/jenkins/jnlpJars/jenkins-cli.jarcat jnlp_slave.xml | java -jar jenkins-cli.jar -s
http://jenkins:8080/jenkins/ create-node my-agent
slaveComputerMac=`echo 'println jenkins.model.Jenkins.instance.nodesObject.getNode("my-agent")?.computer?.jnlpMac' | java -jar jenkins-cli.jar -s
http://jenkins:8080/jenkins/ groovy =`
docker run jenkinsci/jnlp-slave -url
http://jenkins:8080/jenkins/ ${slaveComputerMac} my-agent
Regards,
K.
понедельник, 21 августа 2017 г., 14:57:07 UTC+1 пользователь Kirill написал: