Class: Kamal::Configuration::Registry
- Inherits:
-
Object
- Object
- Kamal::Configuration::Registry
show all
- Includes:
- Validation
- Defined in:
- lib/kamal/configuration/registry.rb
Instance Method Summary
collapse
Methods included from Validation
#validate!, #validation_yml
Constructor Details
#initialize(config:, secrets:, context: "registry") ⇒ Registry
Returns a new instance of Registry.
4
5
6
7
8
|
# File 'lib/kamal/configuration/registry.rb', line 4
def initialize(config:, secrets:, context: "registry")
@registry_config = config["registry"] || {}
@secrets = secrets
validate! registry_config, context: context, with: Kamal::Configuration::Validator::Registry
end
|
Instance Method Details
#local? ⇒ Boolean
22
23
24
|
# File 'lib/kamal/configuration/registry.rb', line 22
def local?
server.to_s.match?("^localhost[:$]")
end
|
#local_port ⇒ Object
26
27
28
|
# File 'lib/kamal/configuration/registry.rb', line 26
def local_port
local? ? (server.split(":").last.to_i || 80) : nil
end
|
#password ⇒ Object
18
19
20
|
# File 'lib/kamal/configuration/registry.rb', line 18
def password
lookup("password")
end
|
#server ⇒ Object
10
11
12
|
# File 'lib/kamal/configuration/registry.rb', line 10
def server
registry_config["server"]
end
|
#username ⇒ Object
14
15
16
|
# File 'lib/kamal/configuration/registry.rb', line 14
def username
lookup("username")
end
|