2018-12-13 13:39:08 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
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
|
2021-03-11 19:13:27 +05:30
|
|
|
[Registry::GitlabRegistry, Registry::DependencyProxy]
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|