builds.md 1.64 KB
Newer Older
1 2
# Builds API

3
API used by runners to receive and update builds.
4

5 6 7 8 9 10
_**Note:** This API is intended to be used only by Runners as their own
communication channel. For the consumer API see the
[Builds API](../../api/builds.md)._

## Authentication

11
This API uses two types of authentication:
12

13 14 15 16 17 18 19 20 21 22 23
1.   Unique runner's token

     Token assigned to runner after it has been registered.

2.   Using build authorization token

     This is project's CI token that can be found in Continuous Integration
     project settings.

     Build authorization token can be passed as a parameter or a value of
     `BUILD-TOKEN` header. This method are interchangeable.
24 25 26 27 28

## Builds

### Runs oldest pending build by runner

29
    POST /ci/api/v1/builds/register
30 31 32

Parameters:

33
  * `token` (required) - Unique runner token
34 35 36 37


### Update details of an existing build

38
    PUT /ci/api/v1/builds/:id
39 40 41 42

Parameters:

  * `id` (required) - The ID of a project
43
  * `token` (required) - Unique runner token
44 45
  * `state` (optional) - The state of a build
  * `trace` (optional) - The trace of a build
46 47 48

### Upload artifacts to build

49
    POST /ci/api/v1/builds/:id/artifacts
50 51 52 53 54 55 56 57 58

Parameters:

  * `id` (required) - The ID of a build
  * `token` (required) - The build authorization token
  * `file` (required) - Artifacts file

### Download the artifacts file from build

59
    GET /ci/api/v1/builds/:id/artifacts
60 61 62 63 64 65 66 67

Parameters:

  * `id` (required) - The ID of a build
  * `token` (required) - The build authorization token

### Remove the artifacts file from build

68
    DELETE /ci/api/v1/builds/:id/artifacts
69 70 71 72 73

Parameters:

  * ` id` (required) - The ID of a build
  * `token` (required) - The build authorization token