Compare commits

..

3 Commits

Author SHA1 Message Date
Donal McBreen
28be0300b9 Bump version for 2.5.1 2025-02-06 13:54:46 +00:00
Donal McBreen
3c2163ab78 Merge pull request #1401 from basecamp/avoid-docker-check-with-skipping-local
Only check for docker when logging in locally
2025-02-06 11:35:49 +00:00
Donal McBreen
fdf7e6927a Only check for docker when logging in locally
If we are skipping a local registry login, we don't need docker
installed locally.

Fixes: https://github.com/basecamp/kamal/issues/1400
2025-02-06 11:12:56 +00:00
4 changed files with 15 additions and 3 deletions

View File

@@ -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)

View File

@@ -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]

View File

@@ -1,3 +1,3 @@
module Kamal
VERSION = "2.5.0"
VERSION = "2.5.1"
end

View File

@@ -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)