Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c8428504d | ||
|
|
8e71c48747 | ||
|
|
67a86e1068 | ||
|
|
b67f40bdf7 | ||
|
|
375f0283c4 | ||
|
|
b8aaddb4c9 | ||
|
|
e6d436f646 |
@@ -1,7 +1,7 @@
|
||||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
kamal (1.5.1)
|
||||
kamal (1.5.2)
|
||||
activesupport (>= 7.0)
|
||||
base64 (~> 0.2)
|
||||
bcrypt_pbkdf (~> 1.0)
|
||||
|
||||
@@ -107,8 +107,9 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
|
||||
if name == "all"
|
||||
KAMAL.accessory_names.each { |accessory_name| details(accessory_name) }
|
||||
else
|
||||
type = "Accessory #{name}"
|
||||
with_accessory(name) do |accessory, hosts|
|
||||
on(hosts) { puts capture_with_info(*accessory.info) }
|
||||
on(hosts) { puts_by_host host, capture_with_info(*accessory.info), type: type }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -30,7 +30,7 @@ class Kamal::Cli::Build < Kamal::Cli::Base
|
||||
end
|
||||
rescue SSHKit::Command::Failed => e
|
||||
if e.message =~ /(no builder)|(no such file or directory)/
|
||||
error "Missing compatible builder, so creating a new one first"
|
||||
warn "Missing compatible builder, so creating a new one first"
|
||||
|
||||
if cli.create
|
||||
KAMAL.with_verbosity(:debug) { execute *KAMAL.builder.push }
|
||||
|
||||
@@ -19,7 +19,7 @@ class Kamal::Commander::Specifics
|
||||
end
|
||||
|
||||
def traefik_hosts
|
||||
specific_hosts || config.traefik_hosts
|
||||
config.traefik_hosts & specified_hosts
|
||||
end
|
||||
|
||||
def accessory_hosts
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module Kamal
|
||||
VERSION = "1.5.1"
|
||||
VERSION = "1.5.2"
|
||||
end
|
||||
|
||||
@@ -76,7 +76,10 @@ class CliAccessoryTest < CliTestCase
|
||||
end
|
||||
|
||||
test "details" do
|
||||
assert_match "docker ps --filter label=service=app-mysql", run_command("details", "mysql")
|
||||
run_command("details", "mysql").tap do |output|
|
||||
assert_match "docker ps --filter label=service=app-mysql", output
|
||||
assert_match "Accessory mysql Host: 1.1.1.3", output
|
||||
end
|
||||
end
|
||||
|
||||
test "details with non-existent accessory" do
|
||||
@@ -85,6 +88,8 @@ class CliAccessoryTest < CliTestCase
|
||||
|
||||
test "details with all" do
|
||||
run_command("details", "all").tap do |output|
|
||||
assert_match "Accessory mysql Host: 1.1.1.3", output
|
||||
assert_match "Accessory redis Host: 1.1.1.2", output
|
||||
assert_match "docker ps --filter label=service=app-mysql", output
|
||||
assert_match "docker ps --filter label=service=app-redis", output
|
||||
end
|
||||
|
||||
@@ -34,7 +34,7 @@ class CliBuildTest < CliTestCase
|
||||
.returns(true)
|
||||
|
||||
run_command("push").tap do |output|
|
||||
assert_match /Missing compatible builder, so creating a new one first/, output
|
||||
assert_match /WARN Missing compatible builder, so creating a new one first/, output
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -131,6 +131,20 @@ class CommanderTest < ActiveSupport::TestCase
|
||||
assert_equal [ "1.1.1.3", "1.1.1.4", "1.1.1.1", "1.1.1.2" ], @kamal.hosts
|
||||
end
|
||||
|
||||
test "traefik hosts should observe filtered roles" do
|
||||
configure_with(:deploy_with_aliases)
|
||||
|
||||
@kamal.specific_roles = [ "web_tokyo" ]
|
||||
assert_equal [ "1.1.1.3", "1.1.1.4" ], @kamal.traefik_hosts
|
||||
end
|
||||
|
||||
test "traefik hosts should observe filtered hosts" do
|
||||
configure_with(:deploy_with_aliases)
|
||||
|
||||
@kamal.specific_hosts = [ "1.1.1.4" ]
|
||||
assert_equal [ "1.1.1.4" ], @kamal.traefik_hosts
|
||||
end
|
||||
|
||||
private
|
||||
def configure_with(variant)
|
||||
@kamal = Kamal::Commander.new.tap do |kamal|
|
||||
|
||||
@@ -83,6 +83,15 @@ class ConfigurationTest < ActiveSupport::TestCase
|
||||
assert_equal [ "1.1.1.1", "1.1.1.2", "1.1.1.3" ], config.traefik_hosts
|
||||
end
|
||||
|
||||
test "filtered traefik hosts" do
|
||||
assert_equal [ "1.1.1.1", "1.1.1.2" ], @config_with_roles.traefik_hosts
|
||||
|
||||
@deploy_with_roles[:servers]["workers"]["traefik"] = true
|
||||
config = Kamal::Configuration.new(@deploy_with_roles)
|
||||
|
||||
assert_equal [ "1.1.1.1", "1.1.1.2", "1.1.1.3" ], config.traefik_hosts
|
||||
end
|
||||
|
||||
test "version no git repo" do
|
||||
ENV.delete("VERSION")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user