Use kamal network for containers

Create a `kamal` network for the proxy and app containers to run in.
This allows the proxy to refer to the app containers by name.
This commit is contained in:
Donal McBreen
2024-03-20 09:26:00 +00:00
parent 9c4747ec0c
commit 00061ce7aa
16 changed files with 51 additions and 50 deletions

View File

@@ -4,13 +4,15 @@ class IntegrationAppTest < IntegrationTest
test "stop, start, boot, logs, images, containers, exec, remove" do
kamal :envify
kamal :setup
kamal :deploy
assert_app_is_up
kamal :app, :stop
assert_app_is_down
assert_app_is_down response_code: "502"
kamal :app, :start
@@ -50,6 +52,6 @@ class IntegrationAppTest < IntegrationTest
kamal :app, :remove
assert_app_is_down
assert_app_is_down response_code: "502"
end
end

View File

@@ -46,8 +46,8 @@ class IntegrationTest < ActiveSupport::TestCase
def assert_app_is_down(response_code: "503")
response = app_response
debug_response_code(response, "503")
assert_equal "503", response.code
debug_response_code(response, response_code)
assert_equal response_code, response.code
end
def assert_app_is_up(version: nil)

View File

@@ -2,6 +2,7 @@ require_relative "integration_test"
class IntegrationMainTest < IntegrationTest
test "envify, deploy, redeploy, rollback, details and audit" do
kamal :server, :bootstrap
kamal :envify
assert_local_env_file "SECRET_TOKEN=1234"
assert_remote_env_file "SECRET_TOKEN=1234"

View File

@@ -2,6 +2,7 @@ require_relative "integration_test"
class IntegrationProxyTest < IntegrationTest
test "boot, reboot, stop, start, restart, logs, remove" do
kamal :server, :bootstrap
kamal :envify
kamal :proxy, :boot