How to select a node name as a parameter in jenkins using a selection list of some sort

10,702

https://wiki.jenkins-ci.org/display/JENKINS/NodeLabel+Parameter+Plugin After installing this plugin you will have an option to add a Node parameter to Jenkins job. It will have a list of all slaves available on current master.

Share:
10,702
Chrispie
Author by

Chrispie

Love to see what I do, hence love to create front ends… Programming is programming but sometimes I do feel that a frond end developer get so more appreciation. I once created a service that did so much… Caching data that refreshes every 5 minutes and most probable anything possible you can do optimise a backend service. To me it was awesome because I knew what was under the hood. Sadly I am the only to think this was awesome lol. Don’t get me wrong. Back end services needs to exists but love the flashy stuff ;) I programmed in Delphi/Pascal in high school and since varsity in Java and VB.net. Later in my career I learned Magic and C#. Back into Java nowadays using several fronts ends (Flex, GWT and JSP’s). Java is awesome and there are so many geeky things to mix it with like Spring. But that said I still love front ends… would like to see where JavaFX is going. And really hope to see it being used in the future. But time will only tell.

Updated on June 04, 2022

Comments

  • Chrispie
    Chrispie almost 2 years

    I need to know if there is a plugin of some sort that you can select a node from a jenkins job and use that node name as a parameter to be passed to a Windows batch command

    I have played with the Configuration Matrix using an Elastic-Axis or Slaves (Screenshot below where you can tick the names) plugins

    enter image description here

    But these all go and execute the Windows batch command on that selected node.

    I don't want to execute it on that server but rather on the main node and only pass the value of the slave/label to the windows batch command.

    I were able to do it as described here but that involves 2 jobs and a groovy scripts to interrogate the slaves/nodes config. Write it to a properties file and pass the properties file to the next job.

    Jenkins: How to get node name from label to use as a parameter

    I need to do about 30 jobs of these and hence would like to try to do all in one job - if I used my solution in the link above, 30 jobs would double in 60 jobs and maintenance would be kind of a nightmare.

    I also would not like to have a string parameter and hard code the name of the slave/node as that will not ensure the use of only the available slaves/nodes but any server name can be entered and that would can be a problem where someone can mistype a server name for example pointing to a Production server instead of a test server.

  • Chrispie
    Chrispie over 8 years
    Not what I want. This allows you to create a node parameter. But if I run a Job it will also execute on that node. I still want to the job to be executed on the master but I need to know the name of the selected node.
  • Zloj
    Zloj over 8 years
    You would need some kind of a node scheduler plugin that actually doesn't utilize any of the nodes from Jenkins point of view, is that correct?
  • Chrispie
    Chrispie over 8 years
    I have a MVN SOAP project that executes tests on a server. The SOAP project needs to know what server to run on. Hence I have the ability to target our DEV TEST and LIVE environment. What I am trying to do is just to have some selection list a project can use to choose from the node list. (we already make use of nodes for deployments). If I can get the node (or server name) into a variable I can pass this to the MVN project which will pass it to the SOAP project to execute on.