Commit Graph
132 Commits
Author SHA1 Message Date
Jacob Vosmaer 0a4db90d36 Use begin/end instead of defined? 2016-02-02 14:35:09 +01:00
Jacob Vosmaer 51574d779c Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into lazy-blobs 2016-02-01 13:51:05 +01:00
Jacob Vosmaer 64c8ee47c9 WIP lazy blobs 2016-02-01 10:41:52 +01:00
Kamil Trzcinski 9b0f57781e Add method that calculates total size for artifacts subfolder 2016-01-20 21:55:13 +01:00
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
Tomasz Maczukin 768721dc58 Merge branch 'master' into ci/api-triggers
* master: (150 commits)
  fixes margin and padding
  Update mailroom/postfix documentation [ci skip]
  Fix css mess around git clone panel. Align it properly
  Fix missing padding for user/group pages
  Fix parse_gollum_tags matcher
  Update documentation on Banzai::Filter::GollumTagsFilter
  Add tests for the wiki pipeline
  Refactoring Banzai::Filter::GollumTagsFilter
  Make sure the .git is at the end on Gitlab::GithubImport::WikiFormatter
  Remove GollumTagsPipeline
  Refactoring Gitlab::GithubImport::Importer
  Remove unnecessary brackets on WIKI_SLUG_ID route constraints
  Move js function to removing accents to vendor/assets/javascripts
  Update CHANGELOG
  Use the WikiPipeline when rendering the wiki markdown content
  Add Banzai::Filter::GollumTagsFilter for parsing Gollum's tags in HTML
  Relax constraints for wiki slug
  Import GitHub wiki into GitLab
  Move Ci::Build#available_statuses to AVAILABLE_STATUSES constant in CommitStatus
  Revert changes to how the notes are paginated in the API
  ...

Conflicts:
	doc/api/README.md
	lib/api/entities.rb
2016-01-14 21:58:17 +01:00
Kamil Trzcinski ac652d82f1 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
2016-01-14 19:45:55 +01:00
Grzegorz Bizon f03da18e3a Merge branch 'ci/view-build-artifacts' into 'master'
Add browser for build artifacts

Discussion in #3426, closes #3426.

See merge request !2123
2016-01-14 12:57:33 +00:00
Tomasz Maczukin af3b97cdde Merge branch 'master' into ci/api-triggers
* master:
  Fix version
  Improve the consistency of commit titles, branch names, tag names, issue/MR titles, on their respective project pages
  Update CHANGELOG [ci skip]
  Add some cosmetic changes to variables API documentation [ci skip]
  Modify builds API documentation style [ci skip]
  Modify :ci_variable factory
  Add 'Build' prefix to Variables entry name in API docs index
  Fix some typos
  Add some fixes after review
  Remove blank line
  Update ./doc/api
  Change :variable_id to :key as resource ID in API
  Fix a typo in method description
  Add create feature to variables API
  Add missing 'not_found' checks in variables API
  Add delete feature to variables API
  Add update feature for variables API
  Add features for list and show details of variables in API

Conflicts:
	doc/api/README.md
	lib/api/entities.rb
2016-01-14 13:09:54 +01:00
Grzegorz Bizon 6b0a43aff3 Improve readability of artifacts browser Entry related code 2016-01-14 12:48:17 +01:00
Grzegorz Bizon 487b0a026f Improvements, readability for artifacts browser 2016-01-14 12:48:16 +01:00
Grzegorz Bizon 09a4a5aff8 Render only valid paths in artifacts metadata
In this version we will support only relative paths in artifacts
metadata. Support for absolute paths will be introduced later.
2016-01-14 12:48:16 +01:00
Grzegorz Bizon 61fb47a432 Simplify implementation of build artifacts browser (refactoring) 2016-01-14 12:48:15 +01:00
Grzegorz Bizon a7f99b67a0 Extract artifacts metadata implementation to separate class 2016-01-14 12:48:15 +01:00
Grzegorz Bizon df41148662 Improve path sanitization in StringPath 2016-01-14 12:48:15 +01:00
Grzegorz Bizon 3de8a4620a Parse artifacts metadata stored in JSON format 2016-01-14 12:48:15 +01:00
Grzegorz Bizon 447f56036e Use metadata stored in artifacats metadata file 2016-01-14 12:48:14 +01:00
Grzegorz Bizon 662f4b9e1d Add artifacts metadata uploader filed
Artifacts metadata field will be used to store a filename of gzipped
file containing metadata definition for given artifacts archive.
2016-01-14 12:48:14 +01:00
Grzegorz Bizon c33b105f11 Make some conditions in Ci::Build more readable 2016-01-14 12:48:14 +01:00
Grzegorz Bizon 5ff7ec42dc Add method that checks if artifacts browser is supported
This is needed because of backward compatibility. Previously artifacts
archive had `.tar.gz` format, but artifacts browser requires ZIP format
now.
2016-01-14 12:48:14 +01:00
Grzegorz Bizon 8eeed761a9 Update specs for CI Build, add artifacts? method
`artifacts?` method checks if artifacts archive is available.
2016-01-14 12:48:14 +01:00
Grzegorz Bizon 9e0e9342a4 Rename method that returns url to CI build artifacts download 2016-01-14 12:48:14 +01:00
Grzegorz Bizon 612ab584bf Mix url_helpers into Ci::Build 2016-01-14 12:48:14 +01:00
Grzegorz Bizon d8cc9e4ef7 Add button to CI build artifacts browser into build summary 2016-01-14 12:48:14 +01:00
Grzegorz Bizon ebd69c5fc1 Remove artifacts metadata column from database 2016-01-14 12:48:13 +01:00
Grzegorz Bizon a96d45c694 Add view action to artifacts controller 2016-01-14 12:48:12 +01:00
Grzegorz Bizon 79fe18d9e7 Move build artifacts implementation to separate controller 2016-01-14 12:48:12 +01:00
Grzegorz Bizon a1cfd2754e Add artifacts_metadata field to Ci::Build
This will contain serialized array of files inside artifacts tarball.
2016-01-14 12:48:12 +01:00
Tomasz Maczukin 57a67c4fdb Merge branch '8-4-stable' into ci/api-triggers
* 8-4-stable: (280 commits)
  Add Changelog entry for build traces data integrity fix
  Update doc_styleguide.md [ci skip]
  Added hint that you can search users by name, username, or email.
  Add changelog
  Version 8.4.0.rc1
  Randomize metrics sample intervals
  Make the metrics sampler interval configurable
  Don't automatically require awesome_print
  Disable colorization if STDOUT is not a tty
  Block the reported user before destroying the record
  changes `$quote-gray` to `$secondary-text`
  makes message plural for multiple MRs and removes from loop. Duh.
  Prepare Installation and Update docs for 8.4 RC1
  Mention channel/key bug in irkerd docs
  Revert "Remove the `:coffee` and `:coffeescript` Haml filters"
  gets merge request discussion working again
  adds back in discussion.haml.html for issues commenting and closing/reopening properly.
  removing last chunk of MR ajax changes, rest will be in another MR
  reverting more MR ajax files, will appear in different commit
  reverting MR ajax changes, which will be in a different MR
  ...
2016-01-14 10:58:40 +01:00
Tomasz Maczukin 220c3a44c9 Merge branch '8-4-stable' into ci/api-variables
* 8-4-stable: (285 commits)
  Add Changelog entry for build traces data integrity fix
  Update doc_styleguide.md [ci skip]
  Added hint that you can search users by name, username, or email.
  Add changelog
  Version 8.4.0.rc1
  Randomize metrics sample intervals
  Make the metrics sampler interval configurable
  Don't automatically require awesome_print
  Disable colorization if STDOUT is not a tty
  Block the reported user before destroying the record
  changes `$quote-gray` to `$secondary-text`
  makes message plural for multiple MRs and removes from loop. Duh.
  Prepare Installation and Update docs for 8.4 RC1
  Mention channel/key bug in irkerd docs
  Revert "Remove the `:coffee` and `:coffeescript` Haml filters"
  gets merge request discussion working again
  adds back in discussion.haml.html for issues commenting and closing/reopening properly.
  removing last chunk of MR ajax changes, rest will be in another MR
  reverting more MR ajax files, will appear in different commit
  reverting MR ajax changes, which will be in a different MR
  ...
2016-01-13 23:59:00 +01:00
Tomasz Maczukin d44653da1f Add some fixes after review 2016-01-13 12:20:59 +01:00
Stan Hu 4b4fdf58c7 Fix Error 500 when visiting build page of project with nil runners_token
Properly ensure that the token exists and add defensively check for a
non-nil value.

Closes #4294
2016-01-10 18:12:47 -08:00
Tomasz Maczukin b60c146267 Change :variable_id to :key as resource ID in API 2016-01-07 13:49:38 +01:00
Stan Hu 79c0e7212a Annotate models 2016-01-06 13:09:55 +00:00
Grzegorz Bizon db2d067eec Fix project destroy callback
See gitlab-org/gitlab-ee!107.
2016-01-05 20:49:31 +01:00
Tomasz Maczukin ea4777ff50 Add features for list and show details of variables in API 2015-12-31 16:26:54 +01:00
Grzegorz Bizon 504696453b Add hotfix that allows to access build artifacts created before 8.3
This is a temporary hotfix that allows to access build artifacts created
before 8.3. See #5257.

This needs to be changed after migrating CI build files.

Note that `ArtifactUploader` uses `artifacts_path` to create a storage
directory before and after parsisting `Ci::Build` instance, before and
after moving a file to store (save and fetch a file).
2015-12-29 09:51:19 +01:00
Grzegorz Bizon 42592201d9 Hotfix for builds trace data integrity
Issue #4246
2015-12-28 15:28:39 +01:00
Douwe Maan 17ed42e362 Merge branch 'issue_3452' 2015-12-21 17:43:58 +01:00
Douwe Maan 058f27ad2a Merge branch 'coverage-regex' into 'master'
Fix build coverage regex matching to allow captures.

Fixes #2644 

/cc @DouweM 

See merge request !2138
2015-12-21 16:25:09 +00:00
Jared Szechy 5a3237fd8d Fix build coverage regex.
Added a spec for regex captures as well.

Fixes #2644
2015-12-20 13:18:14 -05:00
Kamil Trzcinski 58a56a0396 Don't create CI status for refs that doesn't have .gitlab-ci.yml, even if the builds are enabled 2015-12-17 16:33:47 +01:00
Jared Szechy 05e0b6d014 Fix build coverage regex matching to allow captures.
Fixes #2644
2015-12-17 09:59:14 -05:00
Rubén Dávila 3f83a1585f Add link to MR from Build detail page. #3452 2015-12-16 11:54:48 -05:00
Grzegorz Bizon 32d83ee79f Merge branch 'master' into ux/suppress-ci-yml-warning
* master: (24 commits)
  Fix runners admin view
  Fix migrations
  Run builds from projects with enabled CI
  Use Gitlab::Git instead of Ci::Git
  Fix last specs
  Fix specs
  Fix after column rename
  Fix errors
  Update badge
  Finishing touches
  Fix triggers tests
  Rename columns and rename migrations
  Reimplement Trigger API
  Remove ci_ prefix from all ci related things
  Add runners token
  Migrate CI::Project to Project
  Fix indentation and BuildsEmailService
  Change default values
  Enhance migrate CI emails
  Fix issue tracker service
  ...

Conflicts:
	spec/features/commits_spec.rb
2015-12-14 12:25:37 +01:00
Grzegorz Bizon b8f67c5e47 Do not display ci build status if builds enabled but no .gitlab-ci.yml
Ref #3827
2015-12-14 11:28:49 +01:00
Kamil Trzcinski c9ac38a074 Use Gitlab::Git instead of Ci::Git 2015-12-11 18:02:32 +01:00
Kamil Trzcinski 513d551c8f Fix after column rename 2015-12-11 18:02:10 +01:00
Kamil Trzcinski 64bfd9d71a Remove ci_ prefix from all ci related things 2015-12-11 18:02:09 +01:00
Kamil Trzcinski 8cdd54cc06 Add runners token 2015-12-11 18:02:09 +01:00