File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 400
400
pipeline = project .pipelines .get (pipeline_id )
401
401
# end pipeline get
402
402
403
+ # pipeline create
404
+ pipeline = gl .project_pipelines .create ({'project_id' : 1 , 'ref' : 'master' })
405
+ # or
406
+ pipeline = project .pipelines .create ({'ref' : 'master' })
407
+ # end pipeline create
408
+
403
409
# pipeline retry
404
410
pipeline .retry ()
405
411
# end pipeline retry
Original file line number Diff line number Diff line change @@ -438,6 +438,12 @@ Cancel builds in a pipeline:
438
438
:start-after: # pipeline cancel
439
439
:end-before: # end pipeline cancel
440
440
441
+ Create a pipeline for a particular reference:
442
+
443
+ .. literalinclude :: projects.py
444
+ :start-after: # pipeline create
445
+ :end-before: # end pipeline create
446
+
441
447
Services
442
448
--------
443
449
Original file line number Diff line number Diff line change @@ -1991,10 +1991,14 @@ class ProjectFileManager(BaseManager):
1991
1991
1992
1992
class ProjectPipeline (GitlabObject ):
1993
1993
_url = '/projects/%(project_id)s/pipelines'
1994
- canCreate = False
1994
+ _create_url = '/projects/%(project_id)s/pipeline'
1995
+
1995
1996
canUpdate = False
1996
1997
canDelete = False
1997
1998
1999
+ requiredUrlAttrs = ['project_id' ]
2000
+ requiredCreateAttrs = ['ref' ]
2001
+
1998
2002
def retry (self , ** kwargs ):
1999
2003
"""Retries failed builds in a pipeline.
2000
2004
You can’t perform that action at this time.
0 commit comments