Class: Kamal::Commands::Auditor

Inherits:
Base
  • Object
show all
Defined in:
lib/kamal/commands/auditor.rb

Constant Summary

Constants inherited from Base

Base::DOCKER_HEALTH_STATUS_FORMAT

Instance Attribute Summary collapse

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from Base

#container_id_for, #make_directory, #make_directory_for, #remove_directory, #remove_file, #run_over_ssh

Constructor Details

#initialize(config, **details) ⇒ Auditor

Returns a new instance of Auditor.



4
5
6
7
# File 'lib/kamal/commands/auditor.rb', line 4

def initialize(config, **details)
  super(config)
  @details = details
end

Instance Attribute Details

#detailsObject (readonly)

Returns the value of attribute details.



2
3
4
# File 'lib/kamal/commands/auditor.rb', line 2

def details
  @details
end

Instance Method Details

#record(line, **details) ⇒ Object

Runs remotely



10
11
12
13
14
15
16
17
# File 'lib/kamal/commands/auditor.rb', line 10

def record(line, **details)
  combine \
    [ :mkdir, "-p", config.run_directory ],
    append(
      [ :echo, audit_tags(**details).except(:version, :service_version, :service).to_s, line ],
      audit_log_file
    )
end

#revealObject



19
20
21
# File 'lib/kamal/commands/auditor.rb', line 19

def reveal
  [ :tail, "-n", 50, audit_log_file ]
end