Class: Kamal::Cli::Registry
- Inherits:
-
Base
- Object
- Thor
- Base
- Kamal::Cli::Registry
show all
- Defined in:
- lib/kamal/cli/registry.rb
Instance Method Summary
collapse
Methods inherited from Base
dynamic_command_class, exit_on_failure?, #initialize
Instance Method Details
#login ⇒ Object
31
32
33
34
35
36
37
|
# File 'lib/kamal/cli/registry.rb', line 31
def login
if KAMAL.registry.local?
raise "Cannot use login command with a local registry. Use `kamal registry setup` instead."
end
setup
end
|
#logout ⇒ Object
42
43
44
45
46
47
48
|
# File 'lib/kamal/cli/registry.rb', line 42
def logout
if KAMAL.registry.local?
raise "Cannot use logout command with a local registry. Use `kamal registry remove` instead."
end
remove
end
|
#remove ⇒ Object
19
20
21
22
23
24
25
26
|
# File 'lib/kamal/cli/registry.rb', line 19
def remove
if KAMAL.registry.local?
run_locally { execute *KAMAL.registry.remove, raise_on_non_zero_exit: false } unless options[:skip_local]
else
run_locally { execute *KAMAL.registry.logout } unless options[:skip_local]
on(KAMAL.hosts) { execute *KAMAL.registry.logout } unless options[:skip_remote]
end
end
|
#setup ⇒ Object
5
6
7
8
9
10
11
12
13
14
|
# File 'lib/kamal/cli/registry.rb', line 5
def setup
ensure_docker_installed unless options[:skip_local]
if KAMAL.registry.local?
run_locally { execute *KAMAL.registry.setup } unless options[:skip_local]
else
run_locally { execute *KAMAL.registry.login } unless options[:skip_local]
on(KAMAL.hosts) { execute *KAMAL.registry.login } unless options[:skip_remote]
end
end
|