summaryrefslogtreecommitdiff
path: root/lib/gitlab/routes/legacy_builds.rb
blob: 36d1a8a6f648b2f5f4a8c099d1f2256e1a9707e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
module Gitlab
  module Routes
    class LegacyBuilds
      def initialize(map)
        @map = map
      end

      def draw
        @map.instance_eval do
          resources :builds, only: [:index, :show], constraints: { id: /\d+/ } do
            collection do
              resources :artifacts, only: [], controller: 'build_artifacts' do
                collection do
                  get :latest_succeeded,
                    path: '*ref_name_and_path',
                    format: false
                end
              end
            end

            member do
              get :raw
            end

            resource :artifacts, only: [], controller: 'build_artifacts' do
              get :download
              get :browse, path: 'browse(/*path)', format: false
              get :file, path: 'file/*path', format: false
              get :raw, path: 'raw/*path', format: false
            end
          end
        end
      end
    end
  end
end