Module: Gitlab::Client::Pipelines

Included in:
Gitlab::Client
Defined in:
lib/gitlab/client/pipelines.rb

Overview

Defines methods related to pipelines.

Instance Method Summary collapse

Instance Method Details

#cancel_pipeline(project, id) ⇒ Gitlab::ObjectifiedHash

Cancels a pipeline.

Examples:

Gitlab.cancel_pipeline(5, 1)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • id (Integer)

    The ID of a pipeline.

Returns:


52
53
54
# File 'lib/gitlab/client/pipelines.rb', line 52

def cancel_pipeline(project, id)
  post("/projects/#{url_encode project}/pipelines/#{id}/cancel")
end

#create_pipeline(project, ref) ⇒ Gitlab::ObjectifiedHash

Create a pipeline.

Examples:

Gitlab.create_pipeline(5, 'master')

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • ref (String)

    Reference to commit.

Returns:


40
41
42
# File 'lib/gitlab/client/pipelines.rb', line 40

def create_pipeline(project, ref)
  post("/projects/#{url_encode project}/pipeline?ref=#{ref}")
end

#pipeline(project, id) ⇒ Gitlab::ObjectifiedHash

Gets a single pipeline.

Examples:

Gitlab.pipeline(5, 36)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • id (Integer)

    The ID of a pipeline.

Returns:


28
29
30
# File 'lib/gitlab/client/pipelines.rb', line 28

def pipeline(project, id)
  get("/projects/#{url_encode project}/pipelines/#{id}")
end

#pipelines(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of project pipelines.

Examples:

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

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :page (Integer)

    The page number.

  • :per_page (Integer)

    The number of results per page.

Returns:


16
17
18
# File 'lib/gitlab/client/pipelines.rb', line 16

def pipelines(project, options={})
  get("/projects/#{url_encode project}/pipelines", query: options)
end

#retry_pipeline(project, id) ⇒ Array<Gitlab::ObjectifiedHash>

Retry a pipeline.

Examples:

Gitlab.retry_pipeline(5, 1)

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • id (Integer)

    The ID of a pipeline.

Returns:


64
65
66
# File 'lib/gitlab/client/pipelines.rb', line 64

def retry_pipeline(project, id)
  post("/projects/#{url_encode project}/pipelines/#{id}/retry")
end