summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-01-14 16:29:15 +0000
committerDouwe Maan <douwe@gitlab.com>2016-01-14 16:29:15 +0000
commitba42b03348056e511df8484a8b342c7a2129c4f4 (patch)
tree3a7325630be2c373103a9e11acb30ce22e859e56 /lib/api/entities.rb
parent0eef82761fe3a100c4f22c7a1abea3a34dc76edf (diff)
parent2c7d9cfa7dbd4e7716793bdb1ee9e081f13c33b2 (diff)
downloadgitlab-ce-ba42b03348056e511df8484a8b342c7a2129c4f4.tar.gz
Merge branch 'ci/api-builds' into 'master'
Add builds API References #4264 See merge request !2207
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index e2feb7bb6d9..cce46886672 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -367,6 +367,33 @@ module API
expose :id, :variables
end
+ class Runner < Grape::Entity
+ expose :id
+ expose :description
+ expose :active
+ expose :is_shared
+ expose :name
+ end
+
+ class Build < Grape::Entity
+ expose :id, :status, :stage, :name, :ref, :tag, :coverage
+ expose :created_at, :started_at, :finished_at
+ expose :user, with: User
+ # TODO: download_url in Ci:Build model is an GitLab Web Interface URL, not API URL. We should think on some API
+ # for downloading of artifacts (see: https://gitlab.com/gitlab-org/gitlab-ce/issues/4255)
+ expose :download_url do |repo_obj, options|
+ if options[:user_can_download_artifacts]
+ repo_obj.download_url
+ end
+ end
+ expose :commit, with: RepoCommit do |repo_obj, _options|
+ if repo_obj.respond_to?(:commit)
+ repo_obj.commit.commit_data
+ end
+ end
+ expose :runner, with: Runner
+ end
+
class Variable < Grape::Entity
expose :key, :value
end