diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-01-14 19:45:43 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-01-14 19:45:55 +0100 |
commit | ac652d82f17d378e485dcef15a8fabdcf9bad76b (patch) | |
tree | 722e6afd2ea63a43b15886b890138c3def3d5885 /lib/ci | |
parent | ba42b03348056e511df8484a8b342c7a2129c4f4 (diff) | |
download | gitlab-ce-ac652d82f17d378e485dcef15a8fabdcf9bad76b.tar.gz |
Let the CI runner know about builds that this build depends onci/build_dependencies
This allows us to implement artifacts passing: runner will download artifacts from all prior builds
Diffstat (limited to 'lib/ci')
-rw-r--r-- | lib/ci/api/builds.rb | 4 | ||||
-rw-r--r-- | lib/ci/api/entities.rb | 19 |
2 files changed, 17 insertions, 6 deletions
diff --git a/lib/ci/api/builds.rb b/lib/ci/api/builds.rb index fb87637b94f..690bbf97a89 100644 --- a/lib/ci/api/builds.rb +++ b/lib/ci/api/builds.rb @@ -20,7 +20,7 @@ module Ci if build update_runner_info - present build, with: Entities::Build + present build, with: Entities::BuildDetails else not_found! end @@ -111,7 +111,7 @@ module Ci build.artifacts_metadata = metadata if build.save - present(build, with: Entities::Build) + present(build, with: Entities::BuildDetails) else render_validation_error!(build) end diff --git a/lib/ci/api/entities.rb b/lib/ci/api/entities.rb index e4ac0545ea2..835f8c97021 100644 --- a/lib/ci/api/entities.rb +++ b/lib/ci/api/entities.rb @@ -16,10 +16,19 @@ module Ci end class Build < Grape::Entity - expose :id, :commands, :ref, :sha, :status, :project_id, :repo_url, - :before_sha, :allow_git_fetch, :project_name - + expose :id, :ref, :tag, :sha, :status expose :name, :token, :stage + expose :project_id + expose :project_name + expose :artifacts_file, using: ArtifactFile, if: lambda { |build, opts| build.artifacts_file.exists? } + end + + class BuildDetails < Build + expose :commands + expose :repo_url + expose :before_sha + expose :allow_git_fetch + expose :token expose :options do |model| model.options @@ -30,7 +39,9 @@ module Ci end expose :variables - expose :artifacts_file, using: ArtifactFile + expose :dependencies do + expose :depends_on_builds, as: :builds, using: Build + end end class Runner < Grape::Entity |