How to run Jenkins jobs on multiple slaves with a single job configuration?

ANIL

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.

ANIL

I figured it out. It can be achieved using,

Node and Label Parameter Plugin

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.

edited at
0

Comments

0 comments
Login to comment

Related

How to run multiple jobs from a single job in TALEND

Jenkins - How to run one housekeeping job on all nodes (slaves + master)

jenkins job on two slaves?

How to run a Jenkins job on multiple virtual servers?

Jenkins matrix job not triggering multiple downstream jobs

Jenkins executing one job that runs multiple jobs

Jenkins Multiple Builds On Single Job

Spark Opening multiple threads for a single job while trying to run parallel jobs

How to run the same job multiple times in parallel with Jenkins?

Jenkins, Multiple Slaves with multiple Users

Jenkins pipeline - Only run test job once in a sequence of jobs?

Is there a way to run multiple jobs in single pipeline

how to fail a jenkins job while parent jobs calls child job

Calling multiple downstream jobs from an upstream Jenkins pipeline job

Create multiple Jenkins jobs from same repo via SEED job

Jenkins results: Need a "single" summary report of last run of jobs

Jenkins : Trigger Single Downstream job based on multiple upstream job

Run multiple cron jobs where one job takes a long time

run a job after multiple dependent jobs completed in aws glue

Kubernetes Cron Jobs - Run multiple pods for a cron job

how to see the configuration changes in jenkins for a particular job

How to enforce jenkins job to wait until all jobs executed in loop

How do I run multiple jobs with a given IJobConsumer within a single service instance?

Jenkins - matrix jobs - variables on different slaves overwrite each other?

How to run jenkins's job as a specific user?

How to run job with each parameter jenkins

kubernetes dynamic jenkins slaves with multiple build executors

When a jenkins Job runs then its Upstream projects jobs will build automatically or we need to run upstream projects job separately then this job?

How I create a job to run after all jobs in Github Actions