• Stars
    star
    181
  • Rank 210,850 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 13 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Jenkins CLI and node.js client

Avatar

Build Status Dependencies Status Coverage Status Published Version
npm Badge

Nestor

Nestor is a Jenkins CLI and node.js client.

This is handy for Jenkins users who prefer to touch type on the command line over GUI and mouse clicks on the browser. It also serves as an alternative to Jenkins Java CLI where Nestor has shorter commands and executes faster.

console command screenshot

Installation

npm install -g nestor

Usage

Trigger a build:

nestor build <job>

Trigger a parameterised build:

nestor build <job> ["param1=value1&param2=value2"]

Trigger a build followed by console output:

nestor build --console <job>

Trigger a build, wait for 5 seconds, then display console output:

nestor build --pending 5000 --console <job>

Trigger a parameterised build followed by console output:

nestor build <job> ["param1=value1&param2=value2"] --console

Display latest build console output:

nestor console <job>

Display console output of a particular build number:

nestor console <job> [build_number]

Stop currently running build:

nestor stop <job>

View status of all jobs:

nestor dashboard

View job status reports:

nestor job <job>

Enable a job:

nestor enable <job>

Disable a job:

nestor disable <job>

Create a new job with a specified config.xml:

nestor create <job> <path/to/config.xml>

Update an existing job with a specified config.xml:

nestor update <job> <path/to/config.xml>

Copy an existing job1 to a new job2:

nestor copy <job1> <job2>

Delete an existing job:

nestor delete <job>

Fetch the config.xml of an existing job: (experimental)

nestor config <job>

Create a new view with a specified config.xml: (experimental)

nestor create-view <view> <path/to/config.xml>

Update an existing view with a specified config.xml: (experimental)

nestor update-view <view> <path/to/config.xml>

Fetch the config.xml of an existing view: (experimental)

nestor fetch-view-config <view>

View queued jobs:

nestor queue

View executors' status (running builds):

nestor executor

Discover Jenkins instance running on a specified host:

nestor discover <host>

View Jenkins version number:

nestor ver

View builds feed of all jobs:

nestor feed

View builds feed of a job:

nestor --job <job> feed

Monitor build status and notify Ninja Blocks RGB LED device:

export NINJABLOCKS_TOKEN=<token_from_https://a.ninja.is/hacking>
nestor ninja

Note: <job> in the examples is a part of your Jenkins job URL after the first job/.

For example, if you use nested folders on Jenkins and your URL is /job/myproject/job/releases/job/master, then you should pass myproject/job/releases/job/master as <job>.

Programmatically:

var nestor = new (require('nestor'))(
  'http://user:pass@host:port/path'
);

// trigger a standard build
nestor.buildJob('job', '', function (err, result) {
});

// trigger a parameterised build
nestor.buildJob('job', 'param1=value1&param2=value2', function (err, result) {
});

Check out lib/jenkins for other available methods.

NOTE: Starting from version 2.0.0, Nestor started using Swaggy Jenkins as an API client. You can still use Nestor programmatically, but it's much better and cleaner if you use Swaggy Jenkins instead.

Configuration

Jenkins URL

Set Jenkins URL in JENKINS_URL environment variable (defaults to http://localhost:8080):

(*nix)

export JENKINS_URL=http://user:pass@host:port/path

(Windows)

set JENKINS_URL=http://user:pass@host:port/path

As an alternative to password, you can use Jenkins API token instead. Jenkins API token can be found on Jenkins user configuration page.

If http_proxy or https_proxy environment variable is set, then Nestor will automatically use it.

If you want authentication details to be prompted interactively:

JENKINS_URL=http://host:port/path nestor --interactive build job

Jenkins URL can also be specified as an arg:

nestor --url http://user:pass@host:port/path dashboard

SSL client certificate authentication

Set JENKINS_CERT and JENKINS_KEY

(*nix)

export JENKINS_CERT=certificate.pem
export JENKINS_KEY=key.pem

(Windows)

set JENKINS_CERT=certificate.pem
set JENKINS_KEY=key.pem

When you have both key and certificate in one file, currently you have to set both ENV variables to the same file

(*nix)

export JENKINS_CERT=combined.pem
export JENKINS_KEY=combined.pem

(Windows)

set JENKINS_CERT=combined.pem
set JENKINS_KEY=combined.pem

It is possible to specify a custom CA. Just set the JENKINS_CA env variable

(*nix)

export JENKINS_CA=custom.ca.pem

(Windows)

set JENKINS_CA=custom.ca.pem

Translation

To add a new language translation:

  1. Create a locale JSON file in conf/locales/ directory, with the locale's ISO 639-1 code as file name.
  2. Copy paste the content of the existing non-English locale file (anything other than en.json) and modify the translation values accordingly.
  3. Test by executing a command with LANG environment variable, e.g. LANG=<code> nestor dashboard

Contribution

When opening an issue to report a bug, please provide the following information:

  • node.js version: node --version
  • npm version: npm --version
  • Nestor version: nestor --version
  • Jenkins version: nestor ver

Thanks in advance for reporting an issue, opening a feature request, or even better, a pull request!

Colophon

Developer's Guide

Build reports:

Articles:

Videos:

Presentations:

Related Projects:

More Repositories

1

couchtato

CouchDB database iterator tool
JavaScript
66
star
2

datagen

Multi-process test data files generator
JavaScript
40
star
3

bob

Minimalist-omakase build tool for node.js projects
JavaScript
38
star
4

couchpenter

[retired] CouchDB database and document setup tool
JavaScript
20
star
5

ae86

Old school static website generator
JavaScript
18
star
6

swaggy-jenkins

A set of Jenkins API clients in multiple languages generated from Swagger / Open API specification
Java
18
star
7

health

Resource health status checking library
JavaScript
10
star
8

packer-post-processor-json-updater

Packer Post-Processor plugin for updating JSON files
Go
9
star
9

pkjutil

Package.json utility tool
JavaScript
7
star
10

feedpaper

A feed reader + readability mashup for reading on handheld devices
HCL
5
star
11

cmdt

Command-line tool for testing command-line tools
JavaScript
5
star
12

sapi

[retired] Sensis API node.js client
JavaScript
4
star
13

eggtart

[retired] Delicious API node.js client
JavaScript
4
star
14

pokeapi-clients

A set of generated API clients for Poké API from an OpenAPI v3 specification
C++
3
star
15

jenkins-slack-demo

Demo Slack integration with Jenkins CI
JavaScript
3
star
16

sendman

[retired] CLI tool for sending files to a local/remote location
JavaScript
3
star
17

open-sesame

CLI tool for adding your public IP address to AWS security group's inbound rules
JavaScript
3
star
18

bagofholding

[retired] An uncursed bag of various node.js utility functions
JavaScript
3
star
19

bagofcli

A library for defining CLI commands as JSON configuration
JavaScript
3
star
20

openapi-ipify

OpenAPI v3 specification and a set of generated API clients for ipify
HTML
3
star
21

swaggy-jenkins-cli

CLI utility tool for Swaggy Jenkins library
JavaScript
3
star
22

pinterest-sdk

A set of Pinterest SDK in multiple languages generated from Open API specification
C++
2
star
23

packer-swaggy-c

[retired] Packer builder of Docker image which contains Swagger CodeGen supported languages, Swagger CodeGen CLI jar, and Swaggy C
Puppet
2
star
24

pranala

[retired] Yet another URL shortener
JavaScript
2
star
25

breaker

[retired] Utility tool for various server management tools
JavaScript
2
star
26

nestor-lifx

CLI for Jenkins LIFX notifier
JavaScript
2
star
27

roombox

Roomba boombox
JavaScript
2
star
28

packer-kon-tiki

Packer builder of Docker image containing the software needed to build many micro sites maintained by Studio C
Shell
2
star
29

rtk

Agnostic software release tool for managing versions on changelog (keep-a-changelog), multi-format files (JSON, Makefile, text, TOML, YAML), and also for tagging source code of a Git repo
JavaScript
2
star
30

packer-studio

Packer builder of machine image which contains the tech stacks that I use the most
Puppet
2
star
31

ryokan

Some system provisioning Ansible playbooks
Python
2
star
32

swaggy-c

Builder for OpenAPIGenerator-generated API clients in multiple languages
Makefile
2
star
33

nestor-buildlight

CLI for Jenkins build light notifier
JavaScript
2
star
34

usbled-standalone

A USB LED Linux device driver for stand-alone kernel insertion
C
1
star
35

wordniksearch

[retired] Firefox Add-on for Wordnik search
JavaScript
1
star
36

convo-node

node.js utility module for Convo
JavaScript
1
star
37

birthmap

Mapping birth places of groups of prominent people
JavaScript
1
star
38

convo-thomas

Convo agent for Thomas the Tank Engine Facts application
JavaScript
1
star
39

nestor-ninjablocks

[retired] CLI for Jenkins Ninja Blocks notifier
JavaScript
1
star
40

bloojm

[retired] A collection of Blojsom plugins
Java
1
star
41

convo-jenkins

Convo agent and middleware for Jenkins
JavaScript
1
star
42

tagyu4j

[retired] Java library for Tagyu REST web services
Java
1
star
43

jenkins-apiai-demo

Demo api.ai integration with Jenkins CI
Python
1
star
44

ansible-role-droplet-docker

[retired] Ansible Role for setting up Docker on DigitalOcean droplet
Makefile
1
star
45

terraform-kon-tiki

Terraform module for provisioning infrastructure on AWS for hosting static web sites with https support
HCL
1
star
46

wp-emptiness

[retired] Simple and clean minimalist WordPress theme
PHP
1
star
47

buildlight

node.js library for Delcom USB Visual Indicator
JavaScript
1
star
48

tino

Utility script for automatic colourisation of grayscale images
Shell
1
star
49

blogmap4j

[retired] Java library for BlogMap Service APIs
Java
1
star
50

openapi-openai

API client libraries for OpenAI service generated using OpenAPI Generator
Makefile
1
star
51

ansible-role-newrelic-unix

[retired] Ansible Role for setting up NewRelic Unix Plugin
Makefile
1
star
52

yu-gi-oh-card-game

Yu-Gi-Oh! card game on the terminal
1
star
53

convo-jenkins-helper

Helper node.js module for Convo Jenkins
JavaScript
1
star
54

ute

[retired] Unframework for node.js web application
JavaScript
1
star
55

bagofrequest

A bag-of-holding containing request utility functions
JavaScript
1
star
56

convo-generator

Convo agent and middleware generator using Yeoman
HTML
1
star
57

bagoftext

[retired] A bag-of-holding containing text utility functions
JavaScript
1
star
58

generator-bob

[retired] Generator for Bob-built node.js projects
JavaScript
1
star
59

aem-workspace

Simple workspace area for running multiple versions of Adobe Experience Manager (AEM)
Makefile
1
star
60

couchexport

[retired] CouchDB database exporter tool
JavaScript
1
star
61

jazz-cli

CLI for Jazz templating engine
JavaScript
1
star