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:



51
52
53
# File 'lib/buildkit/client/builds.rb', line 51

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:



15
16
17
# File 'lib/buildkit/client/builds.rb', line 15

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

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

Cancel a build

Examples:

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

See Also:



95
96
97
# File 'lib/buildkit/client/builds.rb', line 95

def cancel_build(org, pipeline, number, options = {})
  put("/v2/organizations/#{org}/pipelines/#{pipeline}/builds/#{number}/cancel", 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:



83
84
85
# File 'lib/buildkit/client/builds.rb', line 83

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:



26
27
28
# File 'lib/buildkit/client/builds.rb', line 26

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:



38
39
40
# File 'lib/buildkit/client/builds.rb', line 38

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:



63
64
65
# File 'lib/buildkit/client/builds.rb', line 63

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