Class: Dip::Commands::Compose

Inherits:
Dip::Command show all
Defined in:
lib/dip/commands/compose.rb

Constant Summary collapse

DOCKER_EMBEDDED_DNS =
"127.0.0.11"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Dip::Command

shell, subshell

Constructor Details

#initialize(*argv) ⇒ Compose

Returns a new instance of Compose.



13
14
15
16
# File 'lib/dip/commands/compose.rb', line 13

def initialize(*argv)
  @argv = argv
  @config = ::Dip.config.compose || {}
end

Instance Attribute Details

#argvObject (readonly)

Returns the value of attribute argv.



11
12
13
# File 'lib/dip/commands/compose.rb', line 11

def argv
  @argv
end

#configObject (readonly)

Returns the value of attribute config.



11
12
13
# File 'lib/dip/commands/compose.rb', line 11

def config
  @config
end

Instance Method Details

#executeObject



18
19
20
21
22
23
24
# File 'lib/dip/commands/compose.rb', line 18

def execute
  Dip.env["DIP_DNS"] ||= find_dns

  compose_argv = Array(find_files) + Array(find_project_name) + argv

  shell("docker-compose", compose_argv)
end