Jenkins Swarm plugin - Slave name with RANDOM alphanumeric value Jenkins Swarm plugin - Slave name with RANDOM alphanumeric value jenkins jenkins

Jenkins Swarm plugin - Slave name with RANDOM alphanumeric value


Using option -disableClientsUniqueId in the command line solved it.

I think -name VALUE should be enough but it seems like they have taken the approach that the slave will be created each time (no matter what) and that's why they were suffixing the name with a Unique/Alphanumeric ID value to the slave name. Using the above property solved it (after I did more research and found that they introduced the fix in version 2.0).

Addition: To create Tool locations within the slave's configuration, I used -t Java=~/tools/jdk1.8.0_45 -t Gradle=~/tools/gradle-2.9 and the command gave me an error No tool 'Java' is defined on Jenkins.

javax.servlet.ServletException: java.lang.RuntimeException: No tool 'Java' is defined on Jenkins.

After researching, I found this is because in Jenkins Master (that I used), it's JDK Installations section (within Jenkins global settings) had this tool Name value set as "java".

Trying -t java=~/tools/jdk1.8.0_45 resolved the issue and now I can see (JDK) java tool with value ~/tools/jdk1.8.0_45 in the slave's configuration.

PS: There's no way to define ENVIRONMENTAL variables (like we usually define/see in a node/slave's configuration in Jenkins GUI) using swarm client jar (that's something one can enhance the Swarm plugin with this new feature).


Templorary I resolved this issue with downgrade jenkins-swarm plugin version to 1.2