This is for boot time configuration for the kamal proxy. Config in here doesn't not belong in Kamal::Configuration::Proxy which is for deploy time configuration for the app itself. Kamal apps don't contain boot time config, because multiple apps can share a proxy and the config could conflict.
30 lines
1.1 KiB
Ruby
30 lines
1.1 KiB
Ruby
require "test_helper"
|
|
|
|
class ConfigurationProxyBootTest < ActiveSupport::TestCase
|
|
setup do
|
|
ENV["RAILS_MASTER_KEY"] = "456"
|
|
ENV["VERSION"] = "missing"
|
|
|
|
@deploy = {
|
|
service: "app", image: "dhh/app",
|
|
registry: { "username" => "dhh", "password" => "secret" },
|
|
builder: { "arch" => "amd64" },
|
|
env: { "REDIS_URL" => "redis://x/y" },
|
|
servers: [ "1.1.1.1", "1.1.1.2" ],
|
|
volumes: [ "/local/path:/container/path" ]
|
|
}
|
|
|
|
@config = Kamal::Configuration.new(@deploy)
|
|
@proxy_boot_config = @config.proxy_boot
|
|
end
|
|
|
|
test "proxy directories" do
|
|
assert_equal ".kamal/proxy/apps-config", @proxy_boot_config.apps_directory
|
|
assert_equal "/home/kamal-proxy/.apps-config", @proxy_boot_config.apps_container_directory
|
|
assert_equal ".kamal/proxy/apps-config/app", @proxy_boot_config.app_directory
|
|
assert_equal "/home/kamal-proxy/.apps-config/app", @proxy_boot_config.app_container_directory
|
|
assert_equal ".kamal/proxy/apps-config/app/error_pages", @proxy_boot_config.error_pages_directory
|
|
assert_equal "/home/kamal-proxy/.apps-config/app/error_pages", @proxy_boot_config.error_pages_container_directory
|
|
end
|
|
end
|