Merge pull request #1514 from basecamp/hook-kamal-roles

Add KAMAL_ROLES to hook env variables
This commit is contained in:
Donal McBreen
2025-04-21 10:22:57 +01:00
committed by GitHub
4 changed files with 18 additions and 1 deletions

View File

@@ -133,7 +133,7 @@ module Kamal::Cli
def run_hook(hook, **extra_details)
if !options[:skip_hooks] && KAMAL.hook.hook_exists?(hook)
details = { hosts: KAMAL.hosts.join(","), command: command, subcommand: subcommand }
details = { hosts: KAMAL.hosts.join(","), roles: KAMAL.specific_roles&.join(","), command: command, subcommand: subcommand }.compact
say "Running the #{hook} hook...", :magenta
with_env KAMAL.hook.env(**details, **extra_details) do

View File

@@ -69,6 +69,7 @@ class Kamal::Cli::Proxy < Kamal::Cli::Base
end
end
when "get"
on(KAMAL.proxy_hosts) do |host|
puts "Host #{host}: #{capture_with_info(*KAMAL.proxy.boot_config)}"
end