0.0
No commit activity in last 3 years
No release in over 3 years
Jenkins API wrapper
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.7.0
>= 0
~> 10.1.0
~> 3.0.0
~> 2.14.0
~> 0.7.0
~> 1.13.0
~> 0.8.0.0

Runtime

~> 0.8.0
~> 2.0.0
~> 1.8.0
 Project Readme

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.

Installation

Add this line to your application's Gemfile:

gem 'subordinate'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install subordinate

Documentation

http://rdoc.info/github/jasontruluck/subordinate/master/index

Configuration

Configuration allows for specifying your Jenkins instances variables

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

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
end

Examples

Setting up a new client

client = Subordinate::Client.new(:username => "username", :api_token =>"token")

or

client = Subordinate.new(:username => "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

client.job("Job-Name")

Currently can retrieve information, console output, and timestamps

client.build("Job-Name", 1)

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

client.all_views
client.view("My-Awesome-View-Name")

###System

Currently can safe restart, restart, and quiet down

client.restart

###People

Retrieve the users on the Jenkins server

client.people

Retrieves the current build queue for the Jenkins server

client.build_queue

Retrieves the build executors status and information from the Jenkins server

client.build_executor

Retrieves the load statistics from the Jenkins server

client.load_statistics

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

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