File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 400400pipeline = project .pipelines .get (pipeline_id )
401401# end pipeline get
402402
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+
403409# pipeline retry
404410pipeline .retry ()
405411# end pipeline retry
Original file line number Diff line number Diff line change @@ -438,6 +438,12 @@ Cancel builds in a pipeline:
438438 :start-after: # pipeline cancel
439439 :end-before: # end pipeline cancel
440440
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+
441447Services
442448--------
443449
Original file line number Diff line number Diff line change @@ -1991,10 +1991,14 @@ class ProjectFileManager(BaseManager):
19911991
19921992class ProjectPipeline (GitlabObject ):
19931993 _url = '/projects/%(project_id)s/pipelines'
1994- canCreate = False
1994+ _create_url = '/projects/%(project_id)s/pipeline'
1995+
19951996 canUpdate = False
19961997 canDelete = False
19971998
1999+ requiredUrlAttrs = ['project_id' ]
2000+ requiredCreateAttrs = ['ref' ]
2001+
19982002 def retry (self , ** kwargs ):
19992003 """Retries failed builds in a pipeline.
20002004
You can’t perform that action at this time.
0 commit comments