File tree Expand file tree Collapse file tree 4 files changed +20
-0
lines changed
Expand file tree Collapse file tree 4 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -106,3 +106,7 @@ def __call__(self, chunk):
106106# erase
107107build .erase ()
108108# end erase
109+
110+ # play
111+ build .play ()
112+ # end play
Original file line number Diff line number Diff line change @@ -150,6 +150,12 @@ Cancel/retry a build:
150150 :start-after: # retry
151151 :end-before: # end retry
152152
153+ Play (trigger) a build:
154+
155+ .. literalinclude :: builds.py
156+ :start-after: # play
157+ :end-before: # end play
158+
153159Erase a build (artifacts and trace):
154160
155161.. literalinclude :: builds.py
Original file line number Diff line number Diff line change @@ -95,6 +95,10 @@ class GitlabBuildRetryError(GitlabRetryError):
9595 pass
9696
9797
98+ class GitlabBuildPlayError (GitlabRetryError ):
99+ pass
100+
101+
98102class GitlabBuildEraseError (GitlabRetryError ):
99103 pass
100104
Original file line number Diff line number Diff line change @@ -961,6 +961,12 @@ def retry(self, **kwargs):
961961 r = self .gitlab ._raw_post (url )
962962 raise_error_from_response (r , GitlabBuildRetryError , 201 )
963963
964+ def play (self , ** kwargs ):
965+ """Trigger a build explicitly."""
966+ url = '/projects/%s/builds/%s/play' % (self .project_id , self .id )
967+ r = self .gitlab ._raw_post (url )
968+ raise_error_from_response (r , GitlabBuildPlayError , 201 )
969+
964970 def erase (self , ** kwargs ):
965971 """Erase the build (remove build artifacts and trace)."""
966972 url = '/projects/%s/builds/%s/erase' % (self .project_id , self .id )
You can’t perform that action at this time.
0 commit comments