debian-mirror-gitlab/lib/gitlab/ci/build/credentials/factory.rb
2021-03-11 19:13:27 +05:30

29 lines
539 B
Ruby

# 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