[mproxy](https://github.com/basecamp/parachute) is a custom minimal proxy designed specifically for Kamal. It has two big advantages over Traefik: 1. Imperative deployments - we tell it to switch from container A to container B, and it waits for container B to start then switches. No need to poll for health checks ourselves or mess around with forcing health checks to fail. 2. Support for multiple apps - as much as possible, configuration is supplied at runtime by the deploy command, allowing us to have multiple apps share an instance of mproxy without conflicting config.
34 lines
1.1 KiB
Ruby
34 lines
1.1 KiB
Ruby
require_relative "integration_test"
|
|
|
|
class BrokenDeployTest < IntegrationTest
|
|
test "deploying a bad image" do
|
|
@app = "app_with_roles"
|
|
|
|
kamal :envify
|
|
|
|
first_version = latest_app_version
|
|
|
|
kamal :deploy
|
|
|
|
assert_app_is_up version: first_version
|
|
assert_container_running host: :vm3, name: "app-workers-#{first_version}"
|
|
|
|
second_version = break_app
|
|
|
|
output = kamal :deploy, raise_on_error: false, capture: true
|
|
|
|
assert_failed_deploy output
|
|
assert_app_is_up version: first_version
|
|
assert_container_running host: :vm3, name: "app-workers-#{first_version}"
|
|
assert_container_not_running host: :vm3, name: "app-workers-#{second_version}"
|
|
end
|
|
|
|
private
|
|
def assert_failed_deploy(output)
|
|
assert_match "Waiting for the first healthy web container before booting workers on vm3...", output
|
|
assert_match /First web container is unhealthy on vm[12], not booting other roles/, output
|
|
assert_match "First web container is unhealthy, not booting workers on vm3", output
|
|
assert_match "nginx: [emerg] unexpected end of file, expecting \";\" or \"}\" in /etc/nginx/conf.d/default.conf:2", output
|
|
end
|
|
end
|