jenkins-jobs-runner
v1.0.3
Published
A library for executing jenkins jobs in parallel in CLI
Downloads
11
Readme
jenkins-jobs-runner
A library for executing jenkins jobs in parallel in CLI
✨ Features
- executes sequentially n batches, each of n parallel jobs
- displays visual feedback in terminal
🔧 Installation
yarn add jenkins jenkins-rxjs jenkins-jobs-runner
🎬 Getting started
Let's demonstrate simple usage with an example:
Create an instance of Job Batch Runner:
import { JenkinsRxJs } from 'jenkins-rxjs';
import { JobBatchRunner} from 'jenkins-jobs-runner';
const jenkinsRxJs = new JenkinsRxJs(...);
const jobBatchRunner = new JobBatchRunner(jenkinsRxJs);
Prepare JobBatchDescriptor
array:
const jobBatchDescriptors: JobBatchDescriptor[] = [
{
displayName: 'first group display name',
jobDescriptor: [
{
displayName: 'first job of first group',
opts: {
name: 'jenkins-job-name',
parameters: {
firstParam: 'value-of-param'
}
},
},
{
displayName: 'second one',
opts: { ... },
},
],
},
{
displayName: 'second group',
jobDescriptor: [
{
displayName: 'only job of a second group',
opts: { ... },
},
],
},
];
Execute jobs:
jobBatchRunner.runBatches(builderResult).then(() => console.log('end'));
That is it. jobBatchRunner return a promise when finished should you want to do something afterward.
🎭 Examples
Go checkout adeng-jenkins-cli for examples of integration.
📜 API
Full API can be found here.
🕵️ Troubleshooting
🥂 License
MIT as always