Giter Site home page Giter Site logo

jenkins-cli's Introduction

jenkins-cli

Command line interface for Jenkins

Features

  • Shows state of latest build
  • Shows progress of ongoing build

Installation

npm install -g hjerling/jenkins-cli

You then set the Jenkins host URL with this:

jenkins config -H https://builds.apache.org/

For certificate configurations see the configuration section.

Usage

In the following examples, the job ibl is used as an example.

To view all commands and full usage information:

jenkins -h

To view options for a particular command:

jenkins build-history -h

Build Information

Get information about most recent build for a job:

jenkins build-history ibl -s 1

Get information about a specific build for a job:

jenkins build-history ibl -n 5

Get build history for 10 latest builds for a job:

jenkins build-history ibl

Get build history for all saved builds for a job:

jenkins build-history ibl -a

Get output from the most recent build for a job:

jenkins build-output ibl

Get output from a specific build for a job:

jenkins build-output ibl -n 5

Monitor progress of a ongoing build for a job:

jenkins build-progress ibl

Job Information

Search for a job:

jenkins search ibl

Search among jobs that are currently building:

jenkins search ibl -b

List all jobs:

jenkins search

List all jobs currently building:

jenkins search -b

Build Queue

Show the build queue:

jenkins build-queue

Job Interactions

Trigger a build for a job:

jenkins build ibl

Request for the latest build of a job to stopped:

jenkins stop-build ibl

Request for a specific build of a job to stopped:

jenkins stop-build ibl 5

Configuration

Configuration is stored in the file ~/.jenkins. The object in the file is passed on to the request.defaults function so it is possible to to utilise that if need be.

Set the Jenkins host URL:

jenkins config --host http://jenkins.url

Set the Jenkins host communication certificate:

jenkins config --cert /path/to/certtificate

Set the certificate password:

jenkins config --certPassword c3r71f1c473-p455w0rd

Disable strict SSL checking (useful for self signed certificates):

jenkins config --strictSSL false

Jenkins Server

Show information about the Jenkins Build Server:

jenkins info

Development

  • All interactions with the Jenkins API use the node-jenkins library.
  • The node-jenkins library should closely match the Jenkins API.
  • If your command needs to make multiple Jenkins requests, make multiple calls into the node-jenkins library. Don't add methods to the API library for aggregating calls.
  • To use a local version of the node-jenkins library during development, clone the library and link it from within the jenkins-cli project:
git clone [email protected]:hjerling/jenkins-cli.git
git clone [email protected]:hjerling/node-jenkins.git
cd jenkins-cli
npm link ../node-jenkins
  • To use your local version of jenkins-cli in development you can npm link it globally so that the jenkins command will point to your version:
cd jenkins-cli
npm link .

If you're having any problems with npm link, make sure you've upgraded to a shiny new npm first:

npm install -g npm

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Create new Pull Request.

Thanks

Thanks to Robin Murphy for basic structure of app.

jenkins-cli's People

Stargazers

 avatar

Watchers

 avatar

jenkins-cli's Issues

Example config strings?

I know this sounds funny but do you have any example configs we could see?
I obviously don't want your repos or passwords but I can't seem to get my connection to connect.

Examples of the request.defaults seem very sparce too.

If I have httauth setup infront of my jenkins then is the config supposed to look like this:

{
  "host": "https://MyUserName:[email protected]"
}

Or should it look something like this:

{
  "host": "https://utilit.myjenkinsserver.com",
  "user": "MyUsername",
  "password":"Mypassword"
}

Nothing I've tried works.

I keep getting this error:

The "path" argument must be of type string

Thank you for any pointers or examples.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.