Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
28be0300b9 | ||
|
|
3c2163ab78 | ||
|
|
fdf7e6927a |
@@ -1,7 +1,7 @@
|
||||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
kamal (2.5.0)
|
||||
kamal (2.5.1)
|
||||
activesupport (>= 7.0)
|
||||
base64 (~> 0.2)
|
||||
bcrypt_pbkdf (~> 1.0)
|
||||
|
||||
@@ -3,7 +3,7 @@ class Kamal::Cli::Registry < Kamal::Cli::Base
|
||||
option :skip_local, aliases: "-L", type: :boolean, default: false, desc: "Skip local login"
|
||||
option :skip_remote, aliases: "-R", type: :boolean, default: false, desc: "Skip remote login"
|
||||
def login
|
||||
ensure_docker_installed
|
||||
ensure_docker_installed unless options[:skip_local]
|
||||
|
||||
run_locally { execute *KAMAL.registry.login } unless options[:skip_local]
|
||||
on(KAMAL.hosts) { execute *KAMAL.registry.login } unless options[:skip_remote]
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module Kamal
|
||||
VERSION = "2.5.0"
|
||||
VERSION = "2.5.1"
|
||||
end
|
||||
|
||||
@@ -52,6 +52,18 @@ class CliRegistryTest < CliTestCase
|
||||
assert_raises(Kamal::Cli::DependencyError) { run_command("login") }
|
||||
end
|
||||
|
||||
test "allow remote 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"))
|
||||
|
||||
SSHKit::Backend::Abstract.any_instance.stubs(:execute)
|
||||
.with { |*args| args[0..1] == [ :docker, :login ] }
|
||||
|
||||
assert_nothing_raised { run_command("login", "--skip-local") }
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
def run_command(*command)
|
||||
|
||||
Reference in New Issue
Block a user