summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-01-15 15:54:35 +0000
committerDouwe Maan <douwe@gitlab.com>2016-01-15 15:54:35 +0000
commitc19795dff596a6a7343460a36f4a430c3bf0eb03 (patch)
tree1d87b4373a7fe9151ab656c2ab32a0bf1d842168 /doc
parent57d8faf662930ef0941b364f7b4e2fa1b60a8cf1 (diff)
parent1ce766367eb529fe88068be2f34315f87d74a349 (diff)
downloadgitlab-ce-c19795dff596a6a7343460a36f4a430c3bf0eb03.tar.gz
Merge branch 'ci/build_dependencies' into 'master'
Let the CI runner know about builds that this build depends on This allows us to implement artifacts passing: runner will download artifacts from all prior builds. It will happen automatically, and always, as long as artifacts are enabled. ## The changes: This MR exposes list of prior builds in CI::API::Builds. **The API response when asking for builds** ```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 } ], "dependencies": { "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 } } ] } } ``` ## How it will work? **Example:** ``` build: type: build script: - echo TEST > test_file artifacts: untracked: true rspec: type: test script: - test-my-project staging: type: deploy script: - scp test_file root@server.com: ``` **The flow:** 1. We run `build`. The `build` creates a file `test_file`. This file gets archived and send us build artifacts. 2. We run `rspec`. The `rspec` downloads build artifacts from `build`. Uses the `test_file`. 3. We run `staging`. The `staging` downloads build artifacts from `build` and `rspec`, but since the `rspec` doesn't have build artifacts we skip that build. Deploys the `test_file`. This partially implements the https://gitlab.com/gitlab-org/gitlab-ce/issues/3423. In the next release we will introduce option to configure what artifacts are received. /cc @grzesiek @DouweM @sytse @rspeicher See merge request !2437
Diffstat (limited to 'doc')
-rw-r--r--doc/ci/api/builds.md62
1 files changed, 53 insertions, 9 deletions
diff --git a/doc/ci/api/builds.md b/doc/ci/api/builds.md
index 3b5008ccdb4..018ca22dbbd 100644
--- a/doc/ci/api/builds.md
+++ b/doc/ci/api/builds.md
@@ -18,18 +18,62 @@ Returns:
```json
{
- "id" : 79,
- "commands" : "",
- "path" : "",
- "ref" : "",
- "sha" : "",
- "project_id" : 6,
- "repo_url" : "git@demo.gitlab.com:gitlab/gitlab-shell.git",
- "before_sha" : ""
+ "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