Skip to content

Commit

Permalink
Move the pipelines doc to builds.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauvain Pocentek committed Feb 18, 2018
1 parent 0cbd9c6 commit d416238
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 77 deletions.
52 changes: 49 additions & 3 deletions docs/gl_objects/builds.rst
@@ -1,10 +1,56 @@
###############################
Jobs (v4 API) / Builds (v3 API)
###############################
##########################
Pipelines, Builds and Jobs
##########################

Build and job are two classes representing the same object. Builds are used in
v3 API, jobs in v4 API.

Project pipelines
=================

A pipeline is a group of jobs executed by GitLab CI.

Reference
---------

* v4 API:

+ :class:`gitlab.v4.objects.ProjectPipeline`
+ :class:`gitlab.v4.objects.ProjectPipelineManager`
+ :attr:`gitlab.v4.objects.Project.pipelines`

* v3 API:

+ :class:`gitlab.v3.objects.ProjectPipeline`
+ :class:`gitlab.v3.objects.ProjectPipelineManager`
+ :attr:`gitlab.v3.objects.Project.pipelines`
+ :attr:`gitlab.Gitlab.project_pipelines`

* GitLab API: https://docs.gitlab.com/ce/api/pipelines.html

Examples
--------

List pipelines for a project::

pipelines = project.pipelines.list()

Get a pipeline for a project::

pipeline = project.pipelines.get(pipeline_id)

Create a pipeline for a particular reference::

pipeline = project.pipelines.create({'ref': 'master'})

Retry the failed builds for a pipeline::

pipeline.retry()

Cancel builds in a pipeline::

pipeline.cancel()

Triggers
========

Expand Down
20 changes: 0 additions & 20 deletions docs/gl_objects/projects.py
Expand Up @@ -321,26 +321,6 @@
service.delete()
# end service delete

# pipeline list
pipelines = project.pipelines.list()
# end pipeline list

# pipeline get
pipeline = project.pipelines.get(pipeline_id)
# end pipeline get

# pipeline create
pipeline = project.pipelines.create({'ref': 'master'})
# end pipeline create

# pipeline retry
pipeline.retry()
# end pipeline retry

# pipeline cancel
pipeline.cancel()
# end pipeline cancel

# boards list
boards = project.boards.list()
# end boards list
Expand Down
54 changes: 0 additions & 54 deletions docs/gl_objects/projects.rst
Expand Up @@ -604,60 +604,6 @@ Delete a project hook:
:start-after: # hook delete
:end-before: # end hook delete

Project pipelines
=================

Reference
---------

* v4 API:

+ :class:`gitlab.v4.objects.ProjectPipeline`
+ :class:`gitlab.v4.objects.ProjectPipelineManager`
+ :attr:`gitlab.v4.objects.Project.pipelines`

* v3 API:

+ :class:`gitlab.v3.objects.ProjectPipeline`
+ :class:`gitlab.v3.objects.ProjectPipelineManager`
+ :attr:`gitlab.v3.objects.Project.pipelines`
+ :attr:`gitlab.Gitlab.project_pipelines`

* GitLab API: https://docs.gitlab.com/ce/api/pipelines.html

Examples
--------

List pipelines for a project:

.. literalinclude:: projects.py
:start-after: # pipeline list
:end-before: # end pipeline list

Get a pipeline for a project:

.. literalinclude:: projects.py
:start-after: # pipeline get
:end-before: # end pipeline get

Retry the failed builds for a pipeline:

.. literalinclude:: projects.py
:start-after: # pipeline retry
:end-before: # end pipeline retry

Cancel builds in a pipeline:

.. literalinclude:: projects.py
:start-after: # pipeline cancel
:end-before: # end pipeline cancel

Create a pipeline for a particular reference:

.. literalinclude:: projects.py
:start-after: # pipeline create
:end-before: # end pipeline create

Project Services
================

Expand Down

0 comments on commit d416238

Please sign in to comment.