File tree Expand file tree Collapse file tree 4 files changed +16
-10
lines changed Expand file tree Collapse file tree 4 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -103,10 +103,6 @@ def __call__(self, chunk):
103
103
build .retry ()
104
104
# end retry
105
105
106
- # delete
107
- gl .project_builds .delete (build_id , project_id = 1 )
108
- # or
109
- project .builds .delete (build_id )
110
- # or
111
- build .delete ()
112
- # end delete
106
+ # erase
107
+ build .erase ()
108
+ # end erase
Original file line number Diff line number Diff line change @@ -150,8 +150,8 @@ Cancel/retry a build:
150
150
:start-after: # retry
151
151
:end-before: # end retry
152
152
153
- Erase a build:
153
+ Erase a build (artifacts and trace) :
154
154
155
155
.. literalinclude :: builds.py
156
- :start-after: # delete
157
- :end-before: # end delete
156
+ :start-after: # erase
157
+ :end-before: # end erase
Original file line number Diff line number Diff line change @@ -95,6 +95,10 @@ class GitlabBuildRetryError(GitlabRetryError):
95
95
pass
96
96
97
97
98
+ class GitlabBuildEraseError (GitlabRetryError ):
99
+ pass
100
+
101
+
98
102
class GitlabPipelineRetryError (GitlabRetryError ):
99
103
pass
100
104
Original file line number Diff line number Diff line change @@ -961,6 +961,12 @@ def retry(self, **kwargs):
961
961
r = self .gitlab ._raw_post (url )
962
962
raise_error_from_response (r , GitlabBuildRetryError , 201 )
963
963
964
+ def erase (self , ** kwargs ):
965
+ """Erase the build (remove build artifacts and trace)."""
966
+ url = '/projects/%s/builds/%s/erase' % (self .project_id , self .id )
967
+ r = self .gitlab ._raw_post (url )
968
+ raise_error_from_response (r , GitlabBuildEraseError , 201 )
969
+
964
970
def keep_artifacts (self , ** kwargs ):
965
971
"""Prevent artifacts from being delete when expiration is set.
966
972
You can’t perform that action at this time.
0 commit comments