Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/gl_objects/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,12 @@
pipeline = project.pipelines.get(pipeline_id)
# end pipeline get

# pipeline create
pipeline = gl.project_pipelines.create({'project_id': 1, 'ref': 'master'})
# or
pipeline = project.pipelines.create({'ref': 'master'})
# end pipeline create

# pipeline retry
pipeline.retry()
# end pipeline retry
Expand Down
6 changes: 6 additions & 0 deletions docs/gl_objects/projects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,12 @@ Cancel builds in a pipeline:
: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

Services
--------

Expand Down
6 changes: 5 additions & 1 deletion gitlab/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -1971,10 +1971,14 @@ class ProjectFileManager(BaseManager):

class ProjectPipeline(GitlabObject):
_url = '/projects/%(project_id)s/pipelines'
canCreate = False
_create_url = '/projects/%(project_id)s/pipeline'

canUpdate = False
canDelete = False

requiredUrlAttrs = ['project_id']
requiredCreateAttrs = ['ref']

def retry(self, **kwargs):
"""Retries failed builds in a pipeline.

Expand Down