Options
All
  • Public
  • Public/Protected
  • All
Menu

jenkins-jobs-runner

jenkins-jobs-runner

A library for executing jenkins jobs in parallel in CLI

Build Status NPM version Downloads Standard Version styled with prettier Conventional Commits


✨ Features

  • executes sequentially n batches, each of n parallel jobs
  • displays visual feedback in terminal

jenkins-jobs-runner-demo

🔧 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

Index

Variables

Const processInterrupt$

processInterrupt$: any = Observable.create((observer: Subscriber<void>) => {process.on('exit', () => {process.stdout.write(ansiEscapes.cursorDown(1));process.stdout.write(ansiEscapes.cursorLeft);process.stdout.write(ansiEscapes.cursorShow);observer.next();observer.complete();});process.on('SIGINT', () => {console.log('Caught interrupt signal');process.exit(1);});process.on('SIGUSR1', () => {console.log('Process killed');process.exit(1);});process.on('SIGUSR2', () => {console.log('Process killed');process.exit(1);});process.on('uncaughtException', () => {console.log('Uncaught Exception');process.exit(1);});},).pipe(shareReplay(1))

Functions

uiManagerSimulator

  • uiManagerSimulator(): Promise<void>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc