module Gitlab::Client::Pipelines

Defines methods related to pipelines. @see docs.gitlab.com/ce/api/pipelines.html

Public Instance Methods

cancel_pipeline(project, id) click to toggle source

Cancels a pipeline.

@example

Gitlab.cancel_pipeline(5, 1)

@param [Integer] project The ID of a project. @param [Integer] id The ID of a pipeline. @return [Gitlab::ObjectifiedHash] The pipelines changes.

# File lib/gitlab/client/pipelines.rb, line 52
def cancel_pipeline(project, id)
  post("/projects/#{project}/pipelines/#{id}/cancel")
end
create_pipeline(project, ref) click to toggle source

Create a pipeline.

@example

Gitlab.create_pipeline(5, 'master')

@param [Integer] project The ID of a project. @param [String] ref Reference to commit. @return [Gitlab::ObjectifiedHash] The pipelines changes.

# File lib/gitlab/client/pipelines.rb, line 40
def create_pipeline(project, ref)
  post("/projects/#{project}/pipeline?ref=#{ref}")
end
pipeline(project, id) click to toggle source

Gets a single pipeline.

@example

Gitlab.pipeline(5, 36)

@param [Integer] project The ID of a project. @param [Integer] id The ID of a pipeline. @return [Gitlab::ObjectifiedHash]

# File lib/gitlab/client/pipelines.rb, line 28
def pipeline(project, id)
  get("/projects/#{project}/pipelines/#{id}")
end
pipelines(project, options={}) click to toggle source

Gets a list of project pipelines.

@example

Gitlab.pipelines(5)
Gitlab.pipelines(5, { per_page: 10, page:  2 })

@param [Integer] project The ID of a project. @param [Hash] options A customizable set of options. @option options [Integer] :page The page number. @option options [Integer] :per_page The number of results per page. @return [Array<Gitlab::ObjectifiedHash>]

# File lib/gitlab/client/pipelines.rb, line 16
def pipelines(project, options={})
  get("/projects/#{project}/pipelines", query: options)
end
retry_pipeline(project, id) click to toggle source

Retry a pipeline.

@example

Gitlab.retry_pipeline(5, 1)

@param [Integer] project The ID of a project. @param [Integer] id The ID of a pipeline. @return [Array<Gitlab::ObjectifiedHash>] The pipelines changes.

# File lib/gitlab/client/pipelines.rb, line 64
def retry_pipeline(project, id)
  post("/projects/#{project}/pipelines/#{id}/retry")
end