From 8257400fd78e0fdc26fdcb207dbc6e923332e209 Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Sat, 27 Aug 2016 22:21:49 +0200 Subject: Add support for project pipelines --- docs/gl_objects/projects.py | 20 ++++++++++++++++++++ docs/gl_objects/projects.rst | 31 +++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) (limited to 'docs/gl_objects') diff --git a/docs/gl_objects/projects.py b/docs/gl_objects/projects.py index 0143e31..2695747 100644 --- a/docs/gl_objects/projects.py +++ b/docs/gl_objects/projects.py @@ -382,3 +382,23 @@ service.save() # service delete service.delete() # end service delete + +# pipeline list +pipelines = gl.project_pipelines.list(project_id=1) +# or +pipelines = project.pipelines.list() +# end pipeline list + +# pipeline get +pipeline = gl.project_pipelines.get(pipeline_id, project_id=1) +# or +pipeline = project.pipelines.get(pipeline_id) +# end pipeline get + +# pipeline retry +pipeline.retry() +# end pipeline retry + +# pipeline cancel +pipeline.cancel() +# end pipeline cancel diff --git a/docs/gl_objects/projects.rst b/docs/gl_objects/projects.rst index 5d8e61f..387ba34 100644 --- a/docs/gl_objects/projects.rst +++ b/docs/gl_objects/projects.rst @@ -395,6 +395,37 @@ Delete a project hook: :start-after: # hook delete :end-before: # end hook delete +Pipelines +--------- + +Use :class:`~gitlab.objects.ProjectPipeline` objects to manipulate projects +pipelines. The :attr:`gitlab.Gitlab.project_pipelines` and +:attr:`Project.services ` manager objects +provide helper functions. + +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 Services -------- -- cgit v1.2.1