Class: Mrsk::Commands::Base
- Inherits:
-
Object
- Object
- Mrsk::Commands::Base
- Defined in:
- lib/mrsk/commands/base.rb
Direct Known Subclasses
Accessory, App, Auditor, Builder, Mrsk::Commands::Builder::Base, Healthcheck, Prune, Registry, Traefik
Constant Summary collapse
- MAX_LOG_SIZE =
"10m"
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Instance Method Summary collapse
- #container_id_for(container_name:) ⇒ Object
-
#initialize(config) ⇒ Base
constructor
A new instance of Base.
- #run_over_ssh(*command, host:) ⇒ Object
Constructor Details
#initialize(config) ⇒ Base
Returns a new instance of Base.
9 10 11 |
# File 'lib/mrsk/commands/base.rb', line 9 def initialize(config) @config = config end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
7 8 9 |
# File 'lib/mrsk/commands/base.rb', line 7 def config @config end |
Instance Method Details
#container_id_for(container_name:) ⇒ Object
20 21 22 |
# File 'lib/mrsk/commands/base.rb', line 20 def container_id_for(container_name:) docker :container, :ls, "-a", "-f", "name=#{container_name}", "-q" end |
#run_over_ssh(*command, host:) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/mrsk/commands/base.rb', line 13 def run_over_ssh(*command, host:) "ssh".tap do |cmd| cmd << " -J #{config.ssh_proxy.jump_proxies}" if config.ssh_proxy cmd << " -t #{config.ssh_user}@#{host} '#{command.join(" ")}'" end end |