From ca4cc3572809b086dcf35b0b0f7711dc229e3d02 Mon Sep 17 00:00:00 2001 From: Donal McBreen Date: Fri, 17 Jan 2025 14:46:27 +0000 Subject: [PATCH] Boot accessories after pre-deploy hook That allows you to set proxy config in the hook before booting the proxy. --- lib/kamal/cli/main.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/kamal/cli/main.rb b/lib/kamal/cli/main.rb index 4d55e8907..2fae36e81 100644 --- a/lib/kamal/cli/main.rb +++ b/lib/kamal/cli/main.rb @@ -9,18 +9,14 @@ def setup say "Ensure Docker is installed...", :magenta invoke "kamal:cli:server:bootstrap", [], invoke_options - say "Ensure kamal-proxy is running...", :magenta - invoke "kamal:cli:proxy:boot", [], invoke_options - - invoke "kamal:cli:accessory:boot", [ "all" ], invoke_options - deploy(boot_proxy: false) + deploy(boot_accessories: true) end end end desc "deploy", "Deploy app to servers" option :skip_push, aliases: "-P", type: :boolean, default: false, desc: "Skip image build and push" - def deploy(boot_proxy: true) + def deploy(boot_accessories: false) runtime = print_runtime do invoke_options = deploy_options @@ -39,7 +35,9 @@ def deploy(boot_proxy: true) run_hook "pre-deploy", secrets: true say "Ensure kamal-proxy is running...", :magenta - invoke "kamal:cli:proxy:boot", [], invoke_options if boot_proxy + invoke "kamal:cli:proxy:boot", [], invoke_options + + invoke "kamal:cli:accessory:boot", [ "all" ], invoke_options if boot_accessories say "Detect stale containers...", :magenta invoke "kamal:cli:app:stale_containers", [], invoke_options.merge(stop: true)