Move audits back to run dir so they survive kamal remove

This commit is contained in:
Donal McBreen
2024-09-12 16:05:56 +01:00
parent b8972a6833
commit 35fe9c154d
3 changed files with 13 additions and 11 deletions

View File

@@ -9,7 +9,7 @@ class Kamal::Commands::Auditor < Kamal::Commands::Base
# Runs remotely
def record(line, **details)
combine \
[ :mkdir, "-p", config.service_directory ],
[ :mkdir, "-p", config.run_directory ],
append(
[ :echo, audit_tags(**details).except(:version, :service_version, :service).to_s, line ],
audit_log_file
@@ -22,7 +22,9 @@ class Kamal::Commands::Auditor < Kamal::Commands::Base
private
def audit_log_file
File.join config.service_directory, "audit.log"
file = [ config.service, config.destination, "audit.log" ].compact.join("-")
File.join(config.run_directory, file)
end
def audit_tags(**details)