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

factory.rb « credentials « build « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e8996cb9dc479bd61faf7fe3e90cdd8f17ffc248 (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
# frozen_string_literal: true

module Gitlab
  module Ci
    module Build
      module Credentials
        class Factory
          def initialize(build)
            @build = build
          end

          def create!
            credentials.select(&:valid?)
          end

          private

          def credentials
            providers.map { |provider| provider.new(@build) }
          end

          def providers
            [Registry::GitlabRegistry, Registry::DependencyProxy]
          end
        end
      end
    end
  end
end