summaryrefslogtreecommitdiff
path: root/doc/ci/api/builds.md
blob: 018ca22dbbd749fe3d2f386fee98f45df7722d90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Builds API

This API used by runners to receive and update builds.

__Authentication is done by runner token__

## Builds

### Runs oldest pending build by runner

    POST /ci/builds/register

Parameters:

  * `token` (required) - The unique token of runner

Returns:

```json
{
  "id": 48584,
  "ref": "0.1.1",
  "tag": true,
  "sha": "d63117656af6ff57d99e50cc270f854691f335ad",
  "status": "success",
  "name": "pages",
  "token": "9dd60b4f1a439d1765357446c1084c",
  "stage": "test",
  "project_id": 479,
  "project_name": "test",
  "commands": "echo commands",
  "repo_url": "http://gitlab-ci-token:token@gitlab.example/group/test.git",
  "before_sha": "0000000000000000000000000000000000000000",
  "allow_git_fetch": false,
  "options": {
    "image": "docker:image",
    "artifacts": {
      "paths": [
        "public"
      ]
    },
    "cache": {
      "paths": [
        "vendor"
      ]
    }
  },
  "timeout": 3600,
  "variables": [
    {
      "key": "CI_BUILD_TAG",
      "value": "0.1.1",
      "public": true
    }
  ],
  "depends_on_builds": [
    {
      "id": 48584,
      "ref": "0.1.1",
      "tag": true,
      "sha": "d63117656af6ff57d99e50cc270f854691f335ad",
      "status": "success",
      "name": "build",
      "token": "9dd60b4f1a439d1765357446c1084c",
      "stage": "build",
      "project_id": 479,
      "project_name": "test",
      "artifacts_file": {
        "filename": "artifacts.zip",
        "size": 0
      }
    }
  ]
}
```

### Update details of an existing build

    PUT /ci/builds/:id

Parameters:

  * `id` (required) - The ID of a project
  * `state` (optional) - The state of a build
  * `trace` (optional) - The trace of a build