Add ENV['SERVICE'] to hooks

This commit is contained in:
Nick Hammond
2024-06-27 10:26:11 -06:00
parent 9a1379be6c
commit f1f3fc566f
2 changed files with 4 additions and 1 deletions

View File

@@ -43,6 +43,7 @@ class CliTestCase < ActiveSupport::TestCase
def assert_hook_ran(hook, output, version:, service_version:, hosts:, command:, subcommand: nil, runtime: false)
performer = `whoami`.strip
service = service_version.split("@").first
assert_match "Running the #{hook} hook...\n", output
@@ -52,6 +53,7 @@ class CliTestCase < ActiveSupport::TestCase
KAMAL_PERFORMER=\"#{performer}\"\s
KAMAL_VERSION=\"#{version}\"\s
KAMAL_SERVICE_VERSION=\"#{service_version}\"\s
KAMAL_SERVICE=\"#{service}\"\s
KAMAL_HOSTS=\"#{hosts}\"\s
KAMAL_COMMAND=\"#{command}\"\s
#{"KAMAL_SUBCOMMAND=\\\"#{subcommand}\\\"\\s" if subcommand}