Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c8428504d | ||
|
|
8e71c48747 | ||
|
|
67a86e1068 | ||
|
|
b67f40bdf7 | ||
|
|
375f0283c4 | ||
|
|
b8aaddb4c9 | ||
|
|
e6d436f646 |
@@ -1,7 +1,7 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
kamal (1.5.1)
|
kamal (1.5.2)
|
||||||
activesupport (>= 7.0)
|
activesupport (>= 7.0)
|
||||||
base64 (~> 0.2)
|
base64 (~> 0.2)
|
||||||
bcrypt_pbkdf (~> 1.0)
|
bcrypt_pbkdf (~> 1.0)
|
||||||
|
|||||||
@@ -107,8 +107,9 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
|
|||||||
if name == "all"
|
if name == "all"
|
||||||
KAMAL.accessory_names.each { |accessory_name| details(accessory_name) }
|
KAMAL.accessory_names.each { |accessory_name| details(accessory_name) }
|
||||||
else
|
else
|
||||||
|
type = "Accessory #{name}"
|
||||||
with_accessory(name) do |accessory, hosts|
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class Kamal::Cli::Build < Kamal::Cli::Base
|
|||||||
end
|
end
|
||||||
rescue SSHKit::Command::Failed => e
|
rescue SSHKit::Command::Failed => e
|
||||||
if e.message =~ /(no builder)|(no such file or directory)/
|
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
|
if cli.create
|
||||||
KAMAL.with_verbosity(:debug) { execute *KAMAL.builder.push }
|
KAMAL.with_verbosity(:debug) { execute *KAMAL.builder.push }
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class Kamal::Commander::Specifics
|
|||||||
end
|
end
|
||||||
|
|
||||||
def traefik_hosts
|
def traefik_hosts
|
||||||
specific_hosts || config.traefik_hosts
|
config.traefik_hosts & specified_hosts
|
||||||
end
|
end
|
||||||
|
|
||||||
def accessory_hosts
|
def accessory_hosts
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
module Kamal
|
module Kamal
|
||||||
VERSION = "1.5.1"
|
VERSION = "1.5.2"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -76,7 +76,10 @@ class CliAccessoryTest < CliTestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
test "details" do
|
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
|
end
|
||||||
|
|
||||||
test "details with non-existent accessory" do
|
test "details with non-existent accessory" do
|
||||||
@@ -85,6 +88,8 @@ class CliAccessoryTest < CliTestCase
|
|||||||
|
|
||||||
test "details with all" do
|
test "details with all" do
|
||||||
run_command("details", "all").tap do |output|
|
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-mysql", output
|
||||||
assert_match "docker ps --filter label=service=app-redis", output
|
assert_match "docker ps --filter label=service=app-redis", output
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class CliBuildTest < CliTestCase
|
|||||||
.returns(true)
|
.returns(true)
|
||||||
|
|
||||||
run_command("push").tap do |output|
|
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
|
||||||
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
|
assert_equal [ "1.1.1.3", "1.1.1.4", "1.1.1.1", "1.1.1.2" ], @kamal.hosts
|
||||||
end
|
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
|
private
|
||||||
def configure_with(variant)
|
def configure_with(variant)
|
||||||
@kamal = Kamal::Commander.new.tap do |kamal|
|
@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
|
assert_equal [ "1.1.1.1", "1.1.1.2", "1.1.1.3" ], config.traefik_hosts
|
||||||
end
|
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
|
test "version no git repo" do
|
||||||
ENV.delete("VERSION")
|
ENV.delete("VERSION")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user