Module: Subordinate::Client::Job

Included in:
Subordinate::Client
Defined in:
lib/subordinate/client/job.rb

Overview

Job management and configuration

Instance Method Summary collapse

Instance Method Details

#build_job(job, options = {}) ⇒ Integer

Builds the job specified on the Jenkins server

Examples:

Build the job

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

Parameters:

  • job (String)

    the job that you want to build

Returns:

  • (Integer)

    status

See Also:

Author:

  • Jason Truluck


36
37
38
# 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 = {}) ⇒ Integer

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

Examples:

Build the job

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

Parameters:

  • job (String)

    the job that you want to build

Returns:

  • (Integer)

    status

See Also:

Author:

  • Jason Truluck


53
54
55
# 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 = {}) ⇒ Integer

Deletes the specified job on the Jenkins Server

Examples:

Disable the job

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

Parameters:

  • job (String)

    the job that you want to delete

Returns:

  • (Integer)

    status

See Also:

Author:

  • Jason Truluck


101
102
103
# File 'lib/subordinate/client/job.rb', line 101

def delete_job(job, options = {})
  post("job/#{job}/delete", options)
end

#disable_job(job, options = {}) ⇒ Integer

Disables the specified job on the Jenkins Server

Examples:

Disable the job

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

Parameters:

  • job (String)

    the job that you want to disable

Returns:

  • (Integer)

    status

See Also:

Author:

  • Jason Truluck


69
70
71
# File 'lib/subordinate/client/job.rb', line 69

def disable_job(job, options = {})
  post("job/#{job}/disable", options)
end

#enable_job(job, options = {}) ⇒ Integer

Enables the specified job on the Jenkins Server

Examples:

Enable the job

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

Parameters:

  • job (String)

    the job that you want to enable

Returns:

  • (Integer)

    status

See Also:

Author:

  • Jason Truluck


85
86
87
# File 'lib/subordinate/client/job.rb', line 85

def enable_job(job, options = {})
  post("job/#{job}/enable", options)
end

#job(job, options = {}) ⇒ Hashie::Mash

Returns the response with information about the specific job

Examples:

Get the job api response

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

Parameters:

  • job (String)

    the job that you want to retrieve information about

Returns:

  • (Hashie::Mash)

    job response

See Also:

Author:

  • Jason Truluck


20
21
22
# File 'lib/subordinate/client/job.rb', line 20

def job(job, options = {})
  get("job/#{job}/api/json", options)
end