Module: Buildkit::Client::Builds

Included in:
Buildkit::Client
Defined in:
lib/buildkit/client/builds.rb

Overview

Methods for the Builds API

Instance Method Summary collapse

Instance Method Details

#build(org, pipeline, number, options = {}) ⇒ Sawyer::Resource

Get a build

Examples:

Buildkit.build('my-great-org', 'great-pipeline', 42)

See Also:



49
50
51
# File 'lib/buildkit/client/builds.rb', line 49

def build(org, pipeline, number, options = {})
  get("/v2/organizations/#{org}/pipelines/#{pipeline}/builds/#{number}", options)
end

#builds(options = {}) ⇒ Array<Sawyer::Resource>

List all builds

Examples:

Buildkit.builds

See Also:



13
14
15
# File 'lib/buildkit/client/builds.rb', line 13

def builds(options = {})
  get('/v2/builds', options)
end

#create_build(org, pipeline, options = {}) ⇒ Object

Create a build

Examples:

Buildkit.create_build('my-great-org', 'great-pipeline', {
  commit: 'HEAD',
  branch: 'master',
  message: 'Hello, world!',
  author: {
    name: 'Liam Neeson',
    email: '[email protected]'
  }
})

See Also:



81
82
83
# File 'lib/buildkit/client/builds.rb', line 81

def create_build(org, pipeline, options = {})
  post("/v2/organizations/#{org}/pipelines/#{pipeline}/builds", options)
end

#organization_builds(org, options = {}) ⇒ Array<Sawyer::Resource>

List builds for an organization

Examples:

Buildkit.organization_builds('my-great-org'))

See Also:



24
25
26
# File 'lib/buildkit/client/builds.rb', line 24

def organization_builds(org, options = {})
  get("/v2/organizations/#{org}/builds", options)
end

#pipeline_builds(org, pipeline, options = {}) ⇒ Array<Sawyer::Resource>

List builds for a pipeline

Examples:

Buildkit.pipeline_builds('my-great-org', 'great-pipeline')

See Also:



36
37
38
# File 'lib/buildkit/client/builds.rb', line 36

def pipeline_builds(org, pipeline, options = {})
  get("/v2/organizations/#{org}/pipelines/#{pipeline}/builds", options)
end

#rebuild(org, pipeline, number, options = {}) ⇒ Object

Rebuild a build

Examples:

Buildkit.rebuild('my-great-org', 'great-pipeline', 42)

See Also:



61
62
63
# File 'lib/buildkit/client/builds.rb', line 61

def rebuild(org, pipeline, number, options = {})
  put("/v2/organizations/#{org}/pipelines/#{pipeline}/builds/#{number}/rebuild", options)
end