Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-05-18 14:32:22 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-05-18 14:32:22 +0300
commit566b37ce2188bf9da87aa7ccabece7e92119e790 (patch)
treea9991d2a1fc73c42dc85bcd6cf1afa8744e3b7d2 /config/routes
parent283bff3ca89dc598c8ab5441d41d8da721751bf0 (diff)
Add backward compatible routes for builds
Diffstat (limited to 'config/routes')
-rw-r--r--config/routes/project.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/config/routes/project.rb b/config/routes/project.rb
index 0c8052558c1..77b65e2d162 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -198,6 +198,34 @@ constraints(ProjectUrlConstrainer.new) do
end
end
+ get '/builds/:id/:action', as: 'action_legacy_build',
+ to: redirect { |params, req|
+ args = params.values_at(:namespace_id, :project_id, :id)
+
+ case params[:action]
+ when 'status'
+ Gitlab::Routing.url_helpers.status_namespace_project_job_path(*args, format: params[:format])
+ when 'trace'
+ Gitlab::Routing.url_helpers.trace_namespace_project_job_path(*args, format: params[:format])
+ when 'raw'
+ Gitlab::Routing.url_helpers.raw_namespace_project_job_path(*args)
+ else
+ Gitlab::Routing.url_helpers.namespace_project_job_path(*args)
+ end
+ }
+
+ get '/builds/:id', as: 'legacy_build',
+ to: redirect { |params, req|
+ Gitlab::Routing.url_helpers.namespace_project_job_path(
+ params[:namespace_id], params[:project_id], params[:id])
+ }
+
+ get '/builds', as: 'legacy_builds',
+ to: redirect { |params, req|
+ Gitlab::Routing.url_helpers.namespace_project_jobs_path(
+ params[:namespace_id], params[:project_id])
+ }
+
resources :hooks, only: [:index, :create, :edit, :update, :destroy], constraints: { id: /\d+/ } do
member do
get :test