FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Implement create pipeline API by mondwan · Pull Request #237 · python-gitlab/python-gitlab · GitHub

Repository navigation

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

Filter by extension

Filter by extension .py  (2) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 6 additions & 0 deletions docs/gl_objects/projects.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL