feat: Use git email as performer when available
This commit is contained in:
@@ -9,6 +9,10 @@ module Kamal::Git
|
|||||||
`git config user.name`.strip
|
`git config user.name`.strip
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def email
|
||||||
|
`git config user.email`.strip
|
||||||
|
end
|
||||||
|
|
||||||
def revision
|
def revision
|
||||||
`git rev-parse HEAD`.strip
|
`git rev-parse HEAD`.strip
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class Kamal::Tags
|
|||||||
|
|
||||||
def default_tags(config)
|
def default_tags(config)
|
||||||
{ recorded_at: Time.now.utc.iso8601,
|
{ recorded_at: Time.now.utc.iso8601,
|
||||||
performer: `whoami`.chomp,
|
performer: Kamal::Git.email.presence || `whoami`.chomp,
|
||||||
destination: config.destination,
|
destination: config.destination,
|
||||||
version: config.version,
|
version: config.version,
|
||||||
service_version: service_version(config),
|
service_version: service_version(config),
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class CliTestCase < ActiveSupport::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def assert_hook_ran(hook, output, version:, service_version:, hosts:, command:, subcommand: nil, runtime: false)
|
def assert_hook_ran(hook, output, version:, service_version:, hosts:, command:, subcommand: nil, runtime: false)
|
||||||
performer = `whoami`.strip
|
performer = Kamal::Git.email.presence || `whoami`.chomp
|
||||||
service = service_version.split("@").first
|
service = service_version.split("@").first
|
||||||
|
|
||||||
assert_match "Running the #{hook} hook...\n", output
|
assert_match "Running the #{hook} hook...\n", output
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class CommandsAuditorTest < ActiveSupport::TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
@auditor = new_command
|
@auditor = new_command
|
||||||
@performer = `whoami`.strip
|
@performer = Kamal::Git.email.presence || `whoami`.chomp
|
||||||
@recorded_at = Time.now.utc.iso8601
|
@recorded_at = Time.now.utc.iso8601
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class CommandsHookTest < ActiveSupport::TestCase
|
|||||||
traefik: { "args" => { "accesslog.format" => "json", "metrics.prometheus.buckets" => "0.1,0.3,1.2,5.0" } }
|
traefik: { "args" => { "accesslog.format" => "json", "metrics.prometheus.buckets" => "0.1,0.3,1.2,5.0" } }
|
||||||
}
|
}
|
||||||
|
|
||||||
@performer = `whoami`.strip
|
@performer = Kamal::Git.email.presence || `whoami`.chomp
|
||||||
@recorded_at = Time.now.utc.iso8601
|
@recorded_at = Time.now.utc.iso8601
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user