module Subordinate::Client::Job

Job management and configuration

@see ci.jenkins-ci.org/job/jenkins_rc_branch/api/

Public Instance Methods

build_job(job, options = {}) click to toggle source

Builds the job specified on the Jenkins server

@see ci.jenkins-ci.org/job/jenkins_rc_branch/api/

@param [String] job the job that you want to build

@return [Integer] status

@example Build the job

Subordinate::Client.build("My-Job-I-Want-Info-On")

@author Jason Truluck

# File lib/subordinate/client/job.rb, line 36
def build_job(job, options = {})
  post("job/#{job}/build", options)
end
build_job_with_params(job, options = {}) click to toggle source

Builds the job specified on the Jenkins server with specified parameters Specify the parameters within the options hash

@see ci.jenkins-ci.org/job/jenkins_rc_branch/api/

@param [String] job the job that you want to build

@return [Integer] status

@example Build the job

Subordinate::Client.build_job_with_params("My-Job-I-Want-Info-On", { "some_param" => value })

@author Jason Truluck

# File lib/subordinate/client/job.rb, line 53
def build_job_with_params(job, options = {})
  post("job/#{job}/buildWithParameters", options)
end
delete_job(job, options = {}) click to toggle source

Deletes the specified job on the Jenkins Server

@see ci.jenkins-ci.org/job/jenkins_rc_branch/api/

@param [String] job the job that you want to delete

@return [Integer] status

@example Disable the job

Subordinate::Client.delete("My-Job-I-Want-Info-On")

@author Jason Truluck

# File lib/subordinate/client/job.rb, line 101
def delete_job(job, options = {})
  post("job/#{job}/delete", options)
end
disable_job(job, options = {}) click to toggle source

Disables the specified job on the Jenkins Server

@see ci.jenkins-ci.org/job/jenkins_rc_branch/api/

@param [String] job the job that you want to disable

@return [Integer] status

@example Disable the job

Subordinate::Client.disable("My-Job-I-Want-Info-On")

@author Jason Truluck

# File lib/subordinate/client/job.rb, line 69
def disable_job(job, options = {})
  post("job/#{job}/disable", options)
end
enable_job(job, options = {}) click to toggle source

Enables the specified job on the Jenkins Server

@see ci.jenkins-ci.org/job/jenkins_rc_branch/api/

@param [String] job the job that you want to enable

@return [Integer] status

@example Enable the job

Subordinate::Client.enable("My-Job-I-Want-Info-On")

@author Jason Truluck

# File lib/subordinate/client/job.rb, line 85
def enable_job(job, options = {})
  post("job/#{job}/enable", options)
end
job(job, options = {}) click to toggle source

Returns the response with information about the specific job

@see ci.jenkins-ci.org/job/jenkins_rc_branch/api/json?pretty=true

@param [String] job the job that you want to retrieve information about

@return [Hashie::Mash] job response

@example Get the job api response

Subordinate::Client.job("My-Job-I-Want-Info-On")

@author Jason Truluck

# File lib/subordinate/client/job.rb, line 20
def job(job, options = {})
  get("job/#{job}/api/json", options)
end