summaryrefslogtreecommitdiff
path: root/app/controllers/projects
diff options
context:
space:
mode:
authorShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-02-28 04:17:21 +0900
committerShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-03-23 17:11:48 +0900
commit0e06cfc059af0b70b366ab1eaf75f7601fdcb5e1 (patch)
treed261b7efe8f4541c69331457002ad4bb3b656495 /app/controllers/projects
parent3918c303b967e33ec924d7435ba4e7fcac136c9a (diff)
downloadgitlab-ce-0e06cfc059af0b70b366ab1eaf75f7601fdcb5e1.tar.gz
Add api points for ci cd status. Add favicon.
Diffstat (limited to 'app/controllers/projects')
-rw-r--r--app/controllers/projects/builds_controller.rb6
-rw-r--r--app/controllers/projects/merge_requests_controller.rb8
-rw-r--r--app/controllers/projects/pipelines_controller.rb6
3 files changed, 19 insertions, 1 deletions
diff --git a/app/controllers/projects/builds_controller.rb b/app/controllers/projects/builds_controller.rb
index 886934a3f67..54650bc37a2 100644
--- a/app/controllers/projects/builds_controller.rb
+++ b/app/controllers/projects/builds_controller.rb
@@ -91,6 +91,12 @@ class Projects::BuildsController < Projects::ApplicationController
end
end
+ def ci_cd_status
+ render json: BuildSerializer
+ .new(project: @project, user: @current_user)
+ .represent(@build)
+ end
+
private
def build
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 677a8a1a73a..18b1a5cb395 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -10,7 +10,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
before_action :module_enabled
before_action :merge_request, only: [
:edit, :update, :show, :diffs, :commits, :conflicts, :conflict_for_path, :pipelines, :merge, :merge_check,
- :ci_status, :ci_environments_status, :toggle_subscription, :cancel_merge_when_pipeline_succeeds, :remove_wip, :resolve_conflicts, :assign_related_issues
+ :ci_status, :ci_cd_status, :ci_environments_status, :toggle_subscription, :cancel_merge_when_pipeline_succeeds, :remove_wip, :resolve_conflicts, :assign_related_issues
]
before_action :validates_merge_request, only: [:show, :diffs, :commits, :pipelines]
before_action :define_show_vars, only: [:show, :diffs, :commits, :conflicts, :conflict_for_path, :builds, :pipelines]
@@ -473,6 +473,12 @@ class Projects::MergeRequestsController < Projects::ApplicationController
render json: response
end
+ def ci_cd_status
+ render json: PipelineSerializer
+ .new(project: @project, user: @current_user)
+ .represent(@merge_request.head_pipeline)
+ end
+
def ci_environments_status
environments =
begin
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb
index 718d9e86bea..508d627889c 100644
--- a/app/controllers/projects/pipelines_controller.rb
+++ b/app/controllers/projects/pipelines_controller.rb
@@ -72,6 +72,12 @@ class Projects::PipelinesController < Projects::ApplicationController
end
end
+ def ci_cd_status
+ render json: PipelineSerializer
+ .new(project: @project, user: @current_user)
+ .represent(@pipeline)
+ end
+
def stage
@stage = pipeline.stage(params[:stage])
return not_found unless @stage