I have three different environments each containing a Jenkins Slave,
STAGE1 - slave1
STAGE2 - slave2
STAGE3 - slave3
I don't want to create three different build jobs for them.
I want to pass the slaves (slave1
, slave2
and slave3
) as parameters, so that if I choose slave1
the job gets executed on STAGE1, and if I choose slave2
the job gets executed on STAGE2 and so on.
How to achieve that using a single Jenkins job?
I know there is multi configuration job but I am not clear on how to configure it.
It would be really helpful if I get some information on it.
I figured it out. It can be achieved using,
It lets you create node and label parameter in the job configuration.
Node parameter contains all the nodes present in your Jenkins including master, you can select the nodes you want.
When you run the job with parameters you can select the desired node and the job will get executed in that particular node.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments