Class: Dash::Cli::Registry
- Inherits:
-
Base
- Object
- Thor
- Base
- Dash::Cli::Registry
show all
- Defined in:
- lib/dash/cli/registry.rb
Constant Summary
Constants inherited
from Base
Base::AUTOMATIC_DEPLOY_LOCK_MESSAGE, Base::HOOK_MUTEX, Base::VERBOSITY
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/dash/cli/registry.rb', line 31
def login
if DASH.registry.local?
raise "Cannot use login command with a local registry. Use `dash registry setup` instead."
end
setup
end
|
#logout ⇒ Object
42
43
44
45
46
47
48
|
# File 'lib/dash/cli/registry.rb', line 42
def logout
if DASH.registry.local?
raise "Cannot use logout command with a local registry. Use `dash registry remove` instead."
end
remove
end
|
#remove ⇒ Object
19
20
21
22
23
24
25
26
|
# File 'lib/dash/cli/registry.rb', line 19
def remove
if DASH.registry.local?
run_locally { execute *DASH.registry.remove, raise_on_non_zero_exit: false } unless options[:skip_local]
else
run_locally { execute *DASH.registry.logout } unless options[:skip_local]
on(DASH.hosts) { execute *DASH.registry.logout } unless options[:skip_remote]
end
end
|
#setup ⇒ Object
5
6
7
8
9
10
11
12
13
14
|
# File 'lib/dash/cli/registry.rb', line 5
def setup
ensure_docker_installed unless options[:skip_local]
if DASH.registry.local?
run_locally { execute *DASH.registry.setup } unless options[:skip_local]
else
run_locally { execute *DASH.registry.login } unless options[:skip_local]
on(DASH.hosts) { execute *DASH.registry.login } unless options[:skip_remote]
end
end
|