Subordinate Build Status Code Climate Coverage Status

Subordinate is a api wrapper for the Jenkins API. It is not exhaustive at the moment and is being built out.


Add this line to your application's Gemfile:

gem 'subordinate'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install subordinate



Configuration allows for specifying your Jenkins instances variables

domain - The domain of your Jenkins server i.e.

subdomain - The subdomain of your Jenkins server i.e. jenkins

port - The port of your Jenkins server i.e. 8080

ssl - If you would like to use ssl [Boolean]

Within an initializer config/initializer/subordinate.rb

Subordinate.configure do |c|
  c.subdomain = "subdomain"
  c.domain    = "domain"
  c.port      = 1234
  c.ssl       = false


Setting up a new client

client = => "username", :api_token =>"token")

or ruby client = => "username", :api_token =>"token")

You can also pass configuration keys such as domain, subdomain, port etc. as well.


Currently offers the ability to build, delete, enable/disable jobs



Currently can retrieve information, console output, and timestamps"Job-Name", 1)


Currently can retrieve all views, information about a single view, add jobs to a view, and remove jobs from a view



Currently can safe restart, restart, and quiet down



Retrieve the users on the Jenkins server


Build Queue

Retrieves the current build queue for the Jenkins server


Build Executor

Retrieves the build executors status and information from the Jenkins server


Load Statistics

Retrieves the load statistics from the Jenkins server


Using Depth query parameter

For methods that allow you to specify a depth simply pass the depth you want via an option

client.job("My-awesome-job", {:depth => 1})

The default depth is 0 for all methods.

Using Tree query parameters

tree parameters are more efficient than using depth with exclude. They are available ot any methods that except them via options as well

client.root({:tree => "jobs[name],views[name,jobs[name]]"})

A note from Jenkins: for array-type properties (such as jobs in this example), the name must be given in the original plural, not in the singular as the element would appear in XML (). This will be more natural for e.g. json?tree=jobs[name] anyway: the JSON writer does not do plural-to-singular mangling because arrays are represented explicitly.

Please see the docs for more info on tree parameters


  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