diff options
author | Rémy Coutable <remy@rymai.me> | 2016-07-22 08:46:04 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-07-22 08:46:04 +0000 |
commit | 50124864e389e6813296cc803efac76f7c23b633 (patch) | |
tree | f75e74fbab5674a9e89f26b33b8aa6634d5d5cf1 /doc | |
parent | cbe787c5872318befb9d3cbd2918a44878e04497 (diff) | |
parent | 0b67945c99fde0d2c1ac6287f826001ef4c5d03b (diff) | |
download | gitlab-ce-50124864e389e6813296cc803efac76f7c23b633.tar.gz |
Merge branch 'artifacts-from-ref-and-build-name-api' into 'master'
Simpler two queries than one JOIN with subquery
This is a follow up from !5347
Originally it was:
``` ruby
pipeline = pipelines.latest_successful_for(ref)
builds.where(pipeline: pipeline).latest.with_artifacts
```
However MySQL would complain that we can't use `IN` against a subquery which has `LIMIT`. Using `INNER JOIN` would be a workaround, however, doing that is too complicated in current version of Rails.
So let's just use two queries in this case.
Closes #14419
See merge request !5388
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/builds.md | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/doc/api/builds.md b/doc/api/builds.md index 2adea11247e..24d90e22a9b 100644 --- a/doc/api/builds.md +++ b/doc/api/builds.md @@ -283,6 +283,40 @@ Response: [ce-2893]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2893 +## Download the artifacts file + +> [Introduced][ce-5347] in GitLab 8.10. + +Download the artifacts file from the given reference name and job provided the +build finished successfully. + +``` +GET /projects/:id/builds/artifacts/:ref_name/download?job=name +``` + +Parameters + +| Attribute | Type | Required | Description | +|-------------|---------|----------|-------------------------- | +| `id` | integer | yes | The ID of a project | +| `ref_name` | string | yes | The ref from a repository | +| `job` | string | yes | The name of the job | + +Example request: + +``` +curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/builds/artifacts/master/download?job=test" +``` + +Example response: + +| Status | Description | +|-----------|---------------------------------| +| 200 | Serves the artifacts file | +| 404 | Build not found or no artifacts | + +[ce-5347]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5347 + ## Get a trace file Get a trace of a specific build of a project @@ -409,7 +443,7 @@ POST /projects/:id/builds/:build_id/erase Parameters -| Attribute | Type | required | Description | +| Attribute | Type | Required | Description | |-------------|---------|----------|---------------------| | `id` | integer | yes | The ID of a project | | `build_id` | integer | yes | The ID of a build | @@ -459,7 +493,7 @@ POST /projects/:id/builds/:build_id/artifacts/keep Parameters -| Attribute | Type | required | Description | +| Attribute | Type | Required | Description | |-------------|---------|----------|---------------------| | `id` | integer | yes | The ID of a project | | `build_id` | integer | yes | The ID of a build | |