Class: Gitlab::Ci::Build::Credentials::Registry::GitlabRegistry

Inherits:
Base
  • Object
show all
Defined in:
lib/gitlab/ci/build/credentials/registry/gitlab_registry.rb

Direct Known Subclasses

DependencyProxy

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(build) ⇒ GitlabRegistry

Returns a new instance of GitlabRegistry.


11
12
13
14
# File 'lib/gitlab/ci/build/credentials/registry/gitlab_registry.rb', line 11

def initialize(build)
  @username = Gitlab::Auth::CI_JOB_USER
  @password = build.token
end

Instance Attribute Details

#passwordObject (readonly)

Returns the value of attribute password.


9
10
11
# File 'lib/gitlab/ci/build/credentials/registry/gitlab_registry.rb', line 9

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.


9
10
11
# File 'lib/gitlab/ci/build/credentials/registry/gitlab_registry.rb', line 9

def username
  @username
end

Instance Method Details

#typeObject


24
25
26
# File 'lib/gitlab/ci/build/credentials/registry/gitlab_registry.rb', line 24

def type
  'registry'
end

#urlObject


16
17
18
# File 'lib/gitlab/ci/build/credentials/registry/gitlab_registry.rb', line 16

def url
  Gitlab.config.registry.host_port
end

#valid?Boolean

Returns:

  • (Boolean)

20
21
22
# File 'lib/gitlab/ci/build/credentials/registry/gitlab_registry.rb', line 20

def valid?
  Gitlab.config.registry.enabled
end