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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#type

Constructor Details

#initialize(build) ⇒ Registry

Returns a new instance of Registry.


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

def initialize(build)
  @username = 'gitlab-ci-token'
  @password = build.token
end

Instance Attribute Details

#passwordObject (readonly)

Returns the value of attribute password


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

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username


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

def username
  @username
end

Instance Method Details

#urlObject


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

def url
  Gitlab.config.registry.host_port
end

#valid?Boolean

Returns:

  • (Boolean)

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

def valid?
  Gitlab.config.registry.enabled
end