Skip to content

Commit

Permalink
Boot accessories after pre-deploy hook
Browse files Browse the repository at this point in the history
That allows you to set proxy config in the hook before booting
the proxy.
  • Loading branch information
djmb committed Jan 17, 2025
1 parent 4ffa772 commit ca4cc35
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/kamal/cli/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down

0 comments on commit ca4cc35

Please sign in to comment.