Catch registry credentials errors nicer
This commit is contained in:
@@ -5,10 +5,14 @@ class Mrsk::Cli::Registry < Mrsk::Cli::Base
|
|||||||
def login
|
def login
|
||||||
run_locally { execute *MRSK.registry.login }
|
run_locally { execute *MRSK.registry.login }
|
||||||
on(MRSK.config.hosts) { execute *MRSK.registry.login }
|
on(MRSK.config.hosts) { execute *MRSK.registry.login }
|
||||||
|
rescue ArgumentError => e
|
||||||
|
puts e.message
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "logout", "Logout of the registry remotely"
|
desc "logout", "Logout of the registry remotely"
|
||||||
def logout
|
def logout
|
||||||
on(MRSK.config.hosts) { execute *MRSK.registry.logout }
|
on(MRSK.config.hosts) { execute *MRSK.registry.logout }
|
||||||
|
rescue ArgumentError => e
|
||||||
|
puts e.message
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -105,9 +105,13 @@ class Mrsk::Configuration
|
|||||||
raise ArgumentError, "Missing required configuration for #{key}" unless config[key].present?
|
raise ArgumentError, "Missing required configuration for #{key}" unless config[key].present?
|
||||||
end
|
end
|
||||||
|
|
||||||
%w[ username password ].each do |key|
|
if config.registry["username"].blank?
|
||||||
raise ArgumentError, "Missing required configuration for registry/#{key}" unless config.registry[key].present?
|
raise ArgumentError, "You must specify a username for the registry in config/deploy.yml"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if config.registry["password"].blank?
|
||||||
|
raise ArgumentError, "You must specify a password for the registry in config/deploy.yml (or set the ENV variable if that's used)"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def role_names
|
def role_names
|
||||||
|
|||||||
Reference in New Issue
Block a user