Class: Dip::Commands::Infra::Up
- Inherits:
-
Dip::Command
- Object
- Dip::Command
- Dip::Commands::Infra::Up
- Defined in:
- lib/dip/commands/infra.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(*compose_argv, service:) ⇒ Up
constructor
A new instance of Up.
Methods inherited from Dip::Command
Constructor Details
#initialize(*compose_argv, service:) ⇒ Up
Returns a new instance of Up.
52 53 54 55 |
# File 'lib/dip/commands/infra.rb', line 52 def initialize(*compose_argv, service:) @compose_argv = compose_argv.compact @service = service end |
Instance Method Details
#execute ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'lib/dip/commands/infra.rb', line 57 def execute Dir.chdir(@service.location) do exec_subprocess("docker", "network create #{@service.network_name}", panic: false, err: File::NULL) argv = %w[compose up --detach] + @compose_argv exec_subprocess("docker", argv, env: @service.env) end end |