|
|
|
|
@@ -4,7 +4,7 @@ class CliProxyTest < CliTestCase
|
|
|
|
|
test "boot" do
|
|
|
|
|
run_command("boot").tap do |output|
|
|
|
|
|
assert_match "docker login", output
|
|
|
|
|
assert_match "docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --publish 80:80 --publish 443:443 --volume /var/run/docker.sock:/var/run/docker.sock --volume $(pwd)/.kamal/proxy/config:/home/kamal-proxy/.config/kamal-proxy --log-opt max-size=\"10m\" #{KAMAL.config.proxy_image}", output
|
|
|
|
|
assert_match "docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --publish 80:80 --publish 443:443 --volume kamal-proxy-config:/home/kamal-proxy/.config/kamal-proxy --log-opt max-size=\"10m\" #{KAMAL.config.proxy_image}", output
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@@ -18,7 +18,7 @@ class CliProxyTest < CliTestCase
|
|
|
|
|
exception = assert_raises do
|
|
|
|
|
run_command("boot").tap do |output|
|
|
|
|
|
assert_match "docker login", output
|
|
|
|
|
assert_match "docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --publish 80:80 --publish 443:443 --volume /var/run/docker.sock:/var/run/docker.sock --volume $(pwd)/.kamal/proxy/config:/home/kamal-proxy/.config/kamal-proxy --log-opt max-size=\"10m\" #{KAMAL.config.proxy_image}", output
|
|
|
|
|
assert_match "docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --publish 80:80 --publish 443:443 --volume kamal-proxy-config:/home/kamal-proxy/.config/kamal-proxy --log-opt max-size=\"10m\" #{KAMAL.config.proxy_image}", output
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@@ -36,7 +36,7 @@ class CliProxyTest < CliTestCase
|
|
|
|
|
|
|
|
|
|
run_command("boot").tap do |output|
|
|
|
|
|
assert_match "docker login", output
|
|
|
|
|
assert_match "docker container start kamal-proxy || docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --publish 80:80 --publish 443:443 --volume /var/run/docker.sock:/var/run/docker.sock --volume $(pwd)/.kamal/proxy/config:/home/kamal-proxy/.config/kamal-proxy --log-opt max-size=\"10m\" #{KAMAL.config.proxy_image}", output
|
|
|
|
|
assert_match "docker container start kamal-proxy || docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --publish 80:80 --publish 443:443 --volume kamal-proxy-config:/home/kamal-proxy/.config/kamal-proxy --log-opt max-size=\"10m\" #{KAMAL.config.proxy_image}", output
|
|
|
|
|
end
|
|
|
|
|
ensure
|
|
|
|
|
Thread.report_on_exception = false
|
|
|
|
|
@@ -57,13 +57,13 @@ class CliProxyTest < CliTestCase
|
|
|
|
|
assert_match "docker container stop kamal-proxy on 1.1.1.1", output
|
|
|
|
|
assert_match "Running docker container stop traefik ; docker container prune --force --filter label=org.opencontainers.image.title=Traefik && docker image prune --all --force --filter label=org.opencontainers.image.title=Traefik on 1.1.1.1", output
|
|
|
|
|
assert_match "docker container prune --force --filter label=org.opencontainers.image.title=kamal-proxy on 1.1.1.1", output
|
|
|
|
|
assert_match "docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --publish 80:80 --publish 443:443 --volume /var/run/docker.sock:/var/run/docker.sock --volume $(pwd)/.kamal/proxy/config:/home/kamal-proxy/.config/kamal-proxy --log-opt max-size=\"10m\" #{KAMAL.config.proxy_image} on 1.1.1.1", output
|
|
|
|
|
assert_match "docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --publish 80:80 --publish 443:443 --volume kamal-proxy-config:/home/kamal-proxy/.config/kamal-proxy --log-opt max-size=\"10m\" #{KAMAL.config.proxy_image} on 1.1.1.1", output
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
assert_match "docker container stop kamal-proxy on 1.1.1.2", output
|
|
|
|
|
assert_match "Running docker container stop traefik ; docker container prune --force --filter label=org.opencontainers.image.title=Traefik && docker image prune --all --force --filter label=org.opencontainers.image.title=Traefik on 1.1.1.2", output
|
|
|
|
|
assert_match "docker container prune --force --filter label=org.opencontainers.image.title=kamal-proxy on 1.1.1.2", output
|
|
|
|
|
assert_match "docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --publish 80:80 --publish 443:443 --volume /var/run/docker.sock:/var/run/docker.sock --volume $(pwd)/.kamal/proxy/config:/home/kamal-proxy/.config/kamal-proxy --log-opt max-size=\"10m\" #{KAMAL.config.proxy_image} on 1.1.1.2", output
|
|
|
|
|
assert_match "docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --publish 80:80 --publish 443:443 --volume kamal-proxy-config:/home/kamal-proxy/.config/kamal-proxy --log-opt max-size=\"10m\" #{KAMAL.config.proxy_image} on 1.1.1.2", output
|
|
|
|
|
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
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
@@ -136,7 +136,6 @@ class CliProxyTest < CliTestCase
|
|
|
|
|
assert_match "/usr/bin/env ls .kamal/apps | wc -l", output
|
|
|
|
|
assert_match "docker container prune --force --filter label=org.opencontainers.image.title=kamal-proxy", output
|
|
|
|
|
assert_match "docker image prune --all --force --filter label=org.opencontainers.image.title=kamal-proxy", output
|
|
|
|
|
assert_match "/usr/bin/env rm -r .kamal/proxy", output
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@@ -176,12 +175,6 @@ class CliProxyTest < CliTestCase
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
test "remove_host_directory" do
|
|
|
|
|
run_command("remove_host_directory").tap do |output|
|
|
|
|
|
assert_match "/usr/bin/env rm -r .kamal/proxy", output
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
test "upgrade" do
|
|
|
|
|
Object.any_instance.stubs(:sleep)
|
|
|
|
|
|
|
|
|
|
@@ -205,7 +198,7 @@ class CliProxyTest < CliTestCase
|
|
|
|
|
assert_match "/usr/bin/env mkdir -p .kamal", output
|
|
|
|
|
assert_match "docker network create kamal", output
|
|
|
|
|
assert_match "docker login -u [REDACTED] -p [REDACTED]", output
|
|
|
|
|
assert_match "docker container start kamal-proxy || docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --publish 80:80 --publish 443:443 --volume /var/run/docker.sock:/var/run/docker.sock --volume $(pwd)/.kamal/proxy/config:/home/kamal-proxy/.config/kamal-proxy --log-opt max-size=\"10m\" basecamp/kamal-proxy:#{Kamal::Configuration::PROXY_MINIMUM_VERSION}", output
|
|
|
|
|
assert_match "docker container start kamal-proxy || docker run --name kamal-proxy --network kamal --detach --restart unless-stopped --publish 80:80 --publish 443:443 --volume kamal-proxy-config:/home/kamal-proxy/.config/kamal-proxy --log-opt max-size=\"10m\" basecamp/kamal-proxy:#{Kamal::Configuration::PROXY_MINIMUM_VERSION}", output
|
|
|
|
|
assert_match "/usr/bin/env mkdir -p .kamal", output
|
|
|
|
|
assert_match %r{docker rename app-web-latest app-web-latest_replaced_.*}, output
|
|
|
|
|
assert_match "/usr/bin/env mkdir -p .kamal/apps/app/env/roles", output
|
|
|
|
|
|