| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -319,6 +319,10 @@ Mark a job artifact as kept when expiration is set:: | |||
| 319 | 319 | ||
| 320 | 320 | build_or_job.keep_artifacts() | |
| 321 | 321 | ||
| 322 | + Delete the artifacts of a job:: | ||
| 323 | + | ||
| 324 | + build_or_job.delete_artifacts() | ||
| 325 | + | ||
| 322 | 326 | Get a job trace:: | |
| 323 | 327 | ||
| 324 | 328 | build_or_job.trace() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1584,6 +1584,21 @@ def keep_artifacts(self, **kwargs): | |||
| 1584 | 1584 | path = "%s/%s/artifacts/keep" % (self.manager.path, self.get_id()) | |
| 1585 | 1585 | self.manager.gitlab.http_post(path) | |
| 1586 | 1586 | ||
| 1587 | + @cli.register_custom_action("ProjectJob") | ||
| 1588 | + @exc.on_http_error(exc.GitlabCreateError) | ||
| 1589 | + def delete_artifacts(self, **kwargs): | ||
| 1590 | + """Delete artifacts of a job. | ||
| 1591 | + | ||
| 1592 | + Args: | ||
| 1593 | + **kwargs: Extra options to send to the server (e.g. sudo) | ||
| 1594 | + | ||
| 1595 | + Raises: | ||
| 1596 | + GitlabAuthenticationError: If authentication is not correct | ||
| 1597 | + GitlabDeleteError: If the request could not be performed | ||
| 1598 | + """ | ||
| 1599 | + path = "%s/%s/artifacts" % (self.manager.path, self.get_id()) | ||
| 1600 | + self.manager.gitlab.http_delete(path) | ||
| 1601 | + | ||
| 1587 | 1602 | @cli.register_custom_action("ProjectJob") | |
| 1588 | 1603 | @exc.on_http_error(exc.GitlabGetError) | |
| 1589 | 1604 | def artifacts(self, streamed=False, action=None, chunk_size=1024, **kwargs): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -421,8 +421,9 @@ | |||
| 421 | 421 | ||
| 422 | 422 | # commit status | |
| 423 | 423 | commit = admin_project.commits.list()[0] | |
| 424 | + size = len(commit.statuses.list()) | ||
| 424 | 425 | status = commit.statuses.create({"state": "success", "sha": commit.id}) | |
| 425 | - assert len(commit.statuses.list()) == 1 | ||
| 426 | + assert len(commit.statuses.list()) == size + 1 | ||
| 426 | 427 | ||
| 427 | 428 | assert commit.refs() | |
| 428 | 429 | assert commit.merge_requests() is not None | |
| Back | FazBrowse Home | New Git URL |
0 commit comments