Class: Aircon::Commands::Up

Inherits:
Object
  • Object
show all
Defined in:
lib/aircon/commands/up.rb

Instance Method Summary collapse

Constructor Details

#initialize(config:) ⇒ Up

Returns a new instance of Up.



10
11
12
# File 'lib/aircon/commands/up.rb', line 10

def initialize(config:)
  @config = config
end

Instance Method Details

#call(name, branch:, port: "3001", detach: false) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/aircon/commands/up.rb', line 14

def call(name, branch:, port: "3001", detach: false)
  container = Docker.find_container(project: name, service: @config.service)

  if container
    attach_existing(container, name, detach: detach)
  else
    start_new(name, branch, port, detach: detach)
  end
end