Jenkins implement multiple job using the plug-in parallel and then trigger job

Foreword

Jenkins using automated scripts to automate, sometimes for some reason, or in order to improve the efficiency of the use cases, you may need to create multiple job while running the script.

For example, I had come into contact with Jenkins to run Robot Frameworkautomation scripts, because too many patients use, so consider creating more job to run in parallel, but Robot Frameworkin exactly one consolidated report rebotfunction, so when multiple job finish, it will be consolidated report of each job, and finally got a final report on the results.

But after a number of job creation, we may not know how long it takes to perform each job to be done, so we do not report the combined easy to get, but not good to determine how the results will be reported promptly send them by e-mail and later the internet to find a plug-Jenkins, and it a good solution to my problem.

Join plug-in installation

This is a plug-triggered job, it can be set to wait for all current downstream job job are executed, and then trigger another job, and with it will be a good deal with the above problems.

In Jenkins console, go to System -> Plugin Manager -> Optional plug-ins, the search Jointo find the plug-in installation.

Join plug-in installation

Successful installation

After installation is complete, you can also find the plugin is installed list.

List of installed

Join the use of plug-ins

Join in the use of plug-ins, usually when the current job has a job more downstream in order to reflect its meaning. Therefore, more job creation and design of the following scenarios:

job A: initially triggered Job, it downstream is B1, B2
Job B1: operation portion use cases, and B2 parallel running
job B2: operation portion use cases, and B1 Parallel running
job C: waiting A, B1, B2 are finish after, it will be triggered.

In the job A , the configuration as follows:

Construction of Step

job A configuration steps

After the operation in the construction step of selecting Join Trigger, if no response point was found, the more you can try another plug mounted: Parameterized Triggerrole is to make the plug connector when the respective job can pass some information related to job. After installing the best restart Jenkins, and then click when configuring the job Join Triggerfound normal.

Parameterized Trigger plug-in installation

Bl Job / B2 , for performing a use case, according to the actual situation can be provided.

C the Job , it triggered other Job are executed, the results can be used to aggregate reports and send messages.

After completion of the above settings, when job Atrigger a build after the implementation of its downstream job B1/B2start a parallel run, when job B1/B2are executed, notified by the job are time-consuming to build and triggered job Cby the job Cimplementation of a consolidated report operation, and send mail.

Guess you like

Origin www.cnblogs.com/wintest/p/12212430.html