diff options
-rw-r--r-- | docs/gl_objects/projects.py | 6 | ||||
-rw-r--r-- | docs/gl_objects/projects.rst | 6 | ||||
-rw-r--r-- | gitlab/objects.py | 6 |
3 files changed, 17 insertions, 1 deletions
diff --git a/docs/gl_objects/projects.py b/docs/gl_objects/projects.py index 54bde84..4412f22 100644 --- a/docs/gl_objects/projects.py +++ b/docs/gl_objects/projects.py @@ -400,6 +400,12 @@ pipeline = gl.project_pipelines.get(pipeline_id, project_id=1) 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 diff --git a/docs/gl_objects/projects.rst b/docs/gl_objects/projects.rst index dc6c48b..300b848 100644 --- a/docs/gl_objects/projects.rst +++ b/docs/gl_objects/projects.rst @@ -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 -------- diff --git a/gitlab/objects.py b/gitlab/objects.py index 4790712..119671c 100644 --- a/gitlab/objects.py +++ b/gitlab/objects.py @@ -1991,10 +1991,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. |