From b33c999125c79d4b1079e6d94d7a5666691d46a7 Mon Sep 17 00:00:00 2001 From: Donal McBreen Date: Mon, 9 Sep 2024 16:11:35 +0100 Subject: [PATCH] Remove envify, make proxy booting work with env files --- lib/kamal/cli/proxy.rb | 8 +++++++- lib/kamal/commands/app/execution.rb | 1 - lib/kamal/configuration/docs/env.yml | 2 -- test/integration/main_test.rb | 1 - test/integration/proxy_test.rb | 2 -- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/kamal/cli/proxy.rb b/lib/kamal/cli/proxy.rb index 1092d39c..81b734f7 100644 --- a/lib/kamal/cli/proxy.rb +++ b/lib/kamal/cli/proxy.rb @@ -11,7 +11,13 @@ class Kamal::Cli::Proxy < Kamal::Cli::Base on(KAMAL.traefik_hosts) do |host| execute *KAMAL.registry.login - execute *KAMAL.traefik_or_proxy(host).start_or_run + if KAMAL.proxy_host?(host) + execute *KAMAL.proxy.start_or_run + else + execute *KAMAL.traefik.ensure_env_directory + upload! KAMAL.traefik.secrets_io, KAMAL.traefik.secrets_path, mode: "0600" + execute *KAMAL.traefik.start_or_run + end end end end diff --git a/lib/kamal/commands/app/execution.rb b/lib/kamal/commands/app/execution.rb index 4434c26a..215821dc 100644 --- a/lib/kamal/commands/app/execution.rb +++ b/lib/kamal/commands/app/execution.rb @@ -11,7 +11,6 @@ module Kamal::Commands::App::Execution docker :run, ("-it" if interactive), "--rm", - "--network", "kamal", *role&.env_args(host), *argumentize("--env", env), *config.volume_args, diff --git a/lib/kamal/configuration/docs/env.yml b/lib/kamal/configuration/docs/env.yml index 0ca2bfa9..c2cf0ed0 100644 --- a/lib/kamal/configuration/docs/env.yml +++ b/lib/kamal/configuration/docs/env.yml @@ -24,14 +24,12 @@ env: # KAMAL_REGISTRY_PASSWORD=pw # DB_PASSWORD=secret123 # ``` -# See https://kamal-deploy.org/docs/commands/envify/ for how to use generated .env files. # # To pass the secrets you should list them under the `secret` key. When you do this the # other variables need to be moved under the `clear` key. # # Unlike clear values, secrets are not passed directly to the container, # but are stored in an env file on the host -# The file is not updated when deploying, only when running `kamal envify` or `kamal env push`. env: clear: DB_USER: app diff --git a/test/integration/main_test.rb b/test/integration/main_test.rb index b58aeeb9..1eb05eff 100644 --- a/test/integration/main_test.rb +++ b/test/integration/main_test.rb @@ -76,7 +76,6 @@ class MainTest < IntegrationTest test "aliases" do @app = "app_with_roles" - kamal :envify kamal :deploy output = kamal :whome, capture: true diff --git a/test/integration/proxy_test.rb b/test/integration/proxy_test.rb index 1f444266..f5698592 100644 --- a/test/integration/proxy_test.rb +++ b/test/integration/proxy_test.rb @@ -6,8 +6,6 @@ class ProxyTest < IntegrationTest end test "boot, reboot, stop, start, restart, logs, remove" do - kamal :envify - kamal :proxy, :boot assert_proxy_running