Check for docker locally before registry login
We were checking before `kamal build push`, but not `kamal registry login`. Since `kamal registry login` is called first by a deploy we don't get the nice error message.
This commit is contained in:
@@ -43,6 +43,16 @@ class CliRegistryTest < CliTestCase
|
||||
end
|
||||
end
|
||||
|
||||
test "login with no docker" do
|
||||
stub_setup
|
||||
SSHKit::Backend::Abstract.any_instance.stubs(:execute)
|
||||
.with(:docker, "--version", "&&", :docker, :buildx, "version")
|
||||
.raises(SSHKit::Command::Failed.new("command not found"))
|
||||
|
||||
assert_raises(Kamal::Cli::DependencyError) { run_command("login") }
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
def run_command(*command)
|
||||
stdouted { Kamal::Cli::Registry.start([ *command, "-c", "test/fixtures/deploy_with_accessories.yml" ]) }
|
||||
|
||||
Reference in New Issue
Block a user