@@ -4,7 +4,7 @@ class CliProxyTest < CliTestCase
4
4
test "boot" do
5
5
run_command ( "boot" ) . tap do |output |
6
6
assert_match "docker login" , output
7
- assert_match "docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --volume kamal-proxy-config:/home/kamal-proxy/.config/kamal-proxy $(cat .kamal/proxy/options || echo \" --publish 80:80 --publish 443:443 --log-opt max-size=10m\" ) #{ KAMAL . config . proxy_image } " , output
7
+ assert_match "echo $(cat .kamal/proxy/options 2> /dev/null || echo \" --publish 80:80 --publish 443:443 --log-opt max-size=10m\" ) basecamp/kamal-proxy: #{ Kamal :: Configuration :: PROXY_MINIMUM_VERSION } | xargs docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --volume kamal-proxy- config:/home/kamal-proxy/.config/kamal-proxy " , output
8
8
end
9
9
end
10
10
@@ -18,7 +18,7 @@ class CliProxyTest < CliTestCase
18
18
exception = assert_raises do
19
19
run_command ( "boot" ) . tap do |output |
20
20
assert_match "docker login" , output
21
- assert_match "docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --volume kamal-proxy-config:/home/kamal-proxy/.config/kamal-proxy $(cat .kamal/proxy/options || echo \" --publish 80:80 --publish 443:443 --log-opt max-size=10m\" ) #{ KAMAL . config . proxy_image } " , output
21
+ assert_match "echo $(cat .kamal/proxy/options 2> /dev/null || echo \" --publish 80:80 --publish 443:443 --log-opt max-size=10m\" ) basecamp/kamal-proxy: #{ Kamal :: Configuration :: PROXY_MINIMUM_VERSION } | xargs docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --volume kamal-proxy- config:/home/kamal-proxy/.config/kamal-proxy " , output
22
22
end
23
23
end
24
24
@@ -36,7 +36,7 @@ class CliProxyTest < CliTestCase
36
36
37
37
run_command ( "boot" ) . tap do |output |
38
38
assert_match "docker login" , output
39
- assert_match "docker container start kamal-proxy || docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --volume kamal-proxy-config:/home/kamal-proxy/.config/kamal-proxy $(cat .kamal/proxy/options || echo \" --publish 80:80 --publish 443:443 --log-opt max-size=10m\" ) #{ KAMAL . config . proxy_image } " , output
39
+ assert_match "docker container start kamal-proxy || echo $(cat .kamal/proxy/options 2> /dev/null || echo \" --publish 80:80 --publish 443:443 --log-opt max-size=10m\" ) basecamp/kamal-proxy: #{ Kamal :: Configuration :: PROXY_MINIMUM_VERSION } | xargs docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --volume kamal-proxy- config:/home/kamal-proxy/.config/kamal-proxy " , output
40
40
end
41
41
ensure
42
42
Thread . report_on_exception = false
@@ -56,12 +56,12 @@ class CliProxyTest < CliTestCase
56
56
run_command ( "reboot" , "-y" ) . tap do |output |
57
57
assert_match "docker container stop kamal-proxy on 1.1.1.1" , output
58
58
assert_match "docker container prune --force --filter label=org.opencontainers.image.title=kamal-proxy on 1.1.1.1" , output
59
- assert_match "docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --volume kamal-proxy-config:/home/kamal-proxy/.config/kamal-proxy $(cat .kamal/proxy/options || echo \" --publish 80:80 --publish 443:443 --log-opt max-size=10m\" ) #{ KAMAL . config . proxy_image } on 1.1.1.1" , output
59
+ assert_match "echo $(cat .kamal/proxy/options 2> /dev/null || echo \" --publish 80:80 --publish 443:443 --log-opt max-size=10m\" ) basecamp/kamal-proxy: #{ Kamal :: Configuration :: PROXY_MINIMUM_VERSION } | xargs docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --volume kamal-proxy- config:/home/kamal-proxy/.config/kamal-proxy on 1.1.1.1" , output
60
60
assert_match "docker exec kamal-proxy kamal-proxy deploy app-web --target=\" abcdefabcdef:80\" --deploy-timeout=\" 6s\" --drain-timeout=\" 30s\" --buffer-requests --buffer-responses --log-request-header=\" Cache-Control\" --log-request-header=\" Last-Modified\" --log-request-header=\" User-Agent\" on 1.1.1.1" , output
61
61
62
62
assert_match "docker container stop kamal-proxy on 1.1.1.2" , output
63
63
assert_match "docker container prune --force --filter label=org.opencontainers.image.title=kamal-proxy on 1.1.1.2" , output
64
- assert_match "docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --volume kamal-proxy-config:/home/kamal-proxy/.config/kamal-proxy $(cat .kamal/proxy/options || echo \" --publish 80:80 --publish 443:443 --log-opt max-size=10m\" ) #{ KAMAL . config . proxy_image } on 1.1.1.2" , output
64
+ assert_match "echo $(cat .kamal/proxy/options 2> /dev/null || echo \" --publish 80:80 --publish 443:443 --log-opt max-size=10m\" ) basecamp/kamal-proxy: #{ Kamal :: Configuration :: PROXY_MINIMUM_VERSION } | xargs docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --volume kamal-proxy- config:/home/kamal-proxy/.config/kamal-proxy on 1.1.1.2" , output
65
65
assert_match "docker exec kamal-proxy kamal-proxy deploy app-web --target=\" abcdefabcdef:80\" --deploy-timeout=\" 6s\" --drain-timeout=\" 30s\" --buffer-requests --buffer-responses --log-request-header=\" Cache-Control\" --log-request-header=\" Last-Modified\" --log-request-header=\" User-Agent\" on 1.1.1.2" , output
66
66
end
67
67
end
@@ -196,7 +196,7 @@ class CliProxyTest < CliTestCase
196
196
assert_match "/usr/bin/env mkdir -p .kamal" , output
197
197
assert_match "docker network create kamal" , output
198
198
assert_match "docker login -u [REDACTED] -p [REDACTED]" , output
199
- assert_match "docker container start kamal-proxy || docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --volume kamal-proxy-config:/home/kamal-proxy/.config/kamal-proxy $(cat .kamal/proxy/options || echo \" --publish 80:80 --publish 443:443 --log-opt max-size=10m\" ) basecamp/kamal-proxy:#{ Kamal ::Configuration ::PROXY_MINIMUM_VERSION } " , output
199
+ assert_match "docker container start kamal-proxy || echo $(cat .kamal/proxy/options 2> /dev/null || echo \" --publish 80:80 --publish 443:443 --log-opt max-size=10m\" ) basecamp/kamal-proxy:#{ Kamal ::Configuration ::PROXY_MINIMUM_VERSION } | xargs docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --volume kamal-proxy-config:/home/kamal-proxy/.config/kamal-proxy " , output
200
200
assert_match "/usr/bin/env mkdir -p .kamal" , output
201
201
assert_match %r{docker rename app-web-latest app-web-latest_replaced_.*} , output
202
202
assert_match "/usr/bin/env mkdir -p .kamal/apps/app/env/roles" , output
@@ -316,7 +316,7 @@ class CliProxyTest < CliTestCase
316
316
317
317
test "boot_config get" do
318
318
SSHKit ::Backend ::Abstract . any_instance . expects ( :capture_with_info )
319
- . with ( :cat , ".kamal/proxy/options" , "||" , :echo , "\" --publish 80:80 --publish 443:443 --log-opt max-size=10m\" " )
319
+ . with ( :cat , ".kamal/proxy/options" , "2>" , "/dev/null" , " ||", :echo , "\" --publish 80:80 --publish 443:443 --log-opt max-size=10m\" " )
320
320
. returns ( "--publish 80:80 --publish 8443:443 --label=foo=bar" )
321
321
. twice
322
322
0 commit comments