gitlab-org--gitlab-foss/spec
Douwe Maan c19795dff5 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
2016-01-15 15:54:35 +00:00
..
benchmarks Move Markdown/reference logic from Gitlab::Markdown to Banzai 2015-12-15 15:51:16 +01:00
controllers Merge branch 'unsubscribe-from-thread-from-email-footer' into 'master' 2016-01-14 14:38:55 +00:00
factories Merge branch 'master' into ci/api-triggers 2016-01-14 21:58:17 +01:00
features Add tests for the wiki pipeline 2016-01-14 12:09:31 -02:00
finders remove public field from namespace and refactoring 2016-01-04 16:00:29 +02:00
fixtures Add tests for the wiki pipeline 2016-01-14 12:09:31 -02:00
helpers Use the WikiPipeline when rendering the wiki markdown content 2016-01-14 12:09:31 -02:00
javascripts reverting more MR ajax files, will appear in different commit 2016-01-12 14:55:54 -05:00
lib Refactoring Banzai::Filter::GollumTagsFilter 2016-01-14 12:09:31 -02:00
mailers Minor improvements, unsubscribe from email footer 2016-01-09 19:32:03 +01:00
models Let the CI runner know about builds that this build depends on 2016-01-14 19:45:55 +01:00
requests Merge branch 'ci/build_dependencies' into 'master' 2016-01-15 15:54:35 +00:00
routing Merge branch 'issue_3076' into 'master' 2016-01-08 15:52:05 +00:00
services Merge branch 'feature/ldap-sync-edgecases' into 'master' 2016-01-14 11:00:08 +00:00
support Let the CI runner know about builds that this build depends on 2016-01-14 19:45:55 +01:00
tasks/gitlab
views/help
workers Write to InfluxDB directly via UDP 2015-12-29 14:53:45 +01:00
factories.rb Unsubscribe from thread through link in email footer 2016-01-09 12:41:22 +01:00
factories_spec.rb
rails_helper.rb
spec_helper.rb fix notification_service specs 2015-11-30 11:21:10 +02:00
teaspoon_env.rb