debian-mirror-gitlab/lib/gitlab/ci/build/credentials/registry/gitlab_registry.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
646 B
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
module Gitlab
module Ci
module Build
module Credentials
module Registry
class GitlabRegistry < Credentials::Base
attr_reader :username, :password
def initialize(build)
@username = Gitlab::Auth::CI_JOB_USER
@password = build.token
end
def url
Gitlab.config.registry.host_port
end
def valid?
Gitlab.config.registry.enabled
end
def type
'registry'
end
end
end
end
end
end
end