diff options
Diffstat (limited to 'doc/api/builds.md')
-rw-r--r-- | doc/api/builds.md | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/doc/api/builds.md b/doc/api/builds.md index 43edb40e911..d3ce72e59fc 100644 --- a/doc/api/builds.md +++ b/doc/api/builds.md @@ -34,6 +34,10 @@ Example of response "coverage": null, "created_at": "2015-12-24T15:51:21.802Z", "download_url": null, + "artifacts_file": { + "filename": "artifacts.zip", + "size": 1000 + }, "finished_at": "2015-12-24T17:54:27.895Z", "id": 7, "name": "teaspoon", @@ -72,6 +76,7 @@ Example of response "coverage": null, "created_at": "2015-12-24T15:51:21.727Z", "download_url": null, + "artifacts_file": null, "finished_at": "2015-12-24T17:54:24.921Z", "id": 6, "name": "spinach:other", @@ -135,6 +140,7 @@ Example of response "coverage": null, "created_at": "2016-01-11T10:13:33.506Z", "download_url": null, + "artifacts_file": null, "finished_at": "2016-01-11T10:14:09.526Z", "id": 69, "name": "rubocop", @@ -159,6 +165,7 @@ Example of response "coverage": null, "created_at": "2015-12-24T15:51:21.957Z", "download_url": null, + "artifacts_file": null, "finished_at": "2015-12-24T17:54:33.913Z", "id": 9, "name": "brakeman", @@ -220,6 +227,7 @@ Example of response "coverage": null, "created_at": "2015-12-24T15:51:21.880Z", "download_url": null, + "artifacts_file": null, "finished_at": "2015-12-24T17:54:31.198Z", "id": 8, "name": "rubocop", @@ -247,6 +255,34 @@ Example of response } ``` +## Get build artifacts + +> [Introduced][ce-2893] in GitLab 8.5 + +Get build artifacts of a project + +``` +GET /projects/:id/builds/:build_id/artifacts +``` + +| Attribute | Type | Required | Description | +|------------|---------|----------|---------------------| +| `id` | integer | yes | The ID of a project | +| `build_id` | integer | yes | The ID of a build | + +``` +curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/builds/8/artifacts" +``` + +Response: + +| Status | Description | +|-----------|---------------------------------| +| 200 | Serves the artifacts file | +| 404 | Build not found or no artifacts | + +[ce-2893]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2893 + ## Cancel a build Cancel a single build of a project @@ -280,6 +316,7 @@ Example of response "coverage": null, "created_at": "2016-01-11T10:13:33.506Z", "download_url": null, + "artifacts_file": null, "finished_at": "2016-01-11T10:14:09.526Z", "id": 69, "name": "rubocop", @@ -326,6 +363,7 @@ Example of response "coverage": null, "created_at": "2016-01-11T10:13:33.506Z", "download_url": null, + "artifacts_file": null, "finished_at": null, "id": 69, "name": "rubocop", @@ -338,3 +376,53 @@ Example of response "user": null } ``` + +## Erase a build + +Erase a single build of a project (remove build artifacts and a build trace) + +``` +POST /projects/:id/builds/:build_id/erase +``` + +Parameters + +| Attribute | Type | required | Description | +|-------------|---------|----------|---------------------| +| `id` | integer | yes | The ID of a project | +| `build_id` | integer | yes | The ID of a build | + +Example of request + +``` +curl -X POST -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/builds/1/erase" +``` + +Example of response + +```json +{ + "commit": { + "author_email": "admin@example.com", + "author_name": "Administrator", + "created_at": "2015-12-24T16:51:14.000+01:00", + "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd", + "message": "Test the CI integration.", + "short_id": "0ff3ae19", + "title": "Test the CI integration." + }, + "coverage": null, + "download_url": null, + "id": 69, + "name": "rubocop", + "ref": "master", + "runner": null, + "stage": "test", + "created_at": "2016-01-11T10:13:33.506Z", + "started_at": "2016-01-11T10:13:33.506Z", + "finished_at": "2016-01-11T10:15:10.506Z", + "status": "failed", + "tag": false, + "user": null +} +``` |