Class: GrokCLI::Docker::WordPress::Init

Inherits:
Object
  • Object
show all
Defined in:
lib/grok_cli/docker/wordpress/init.rb

Instance Method Summary collapse

Instance Method Details

#execute(hostname, machine_name) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/grok_cli/docker/wordpress/init.rb', line 8

def execute(hostname, machine_name)
  FileUtils.cp(template_path('docker-compose.yml'), '.')
  puts "Created docker-compose.yml"

  File.open('.grok-cli.yml', 'w') do |file|
    file.write(render_grok_cli(hostname, machine_name))
    puts "Created .grok-cli.yml"
  end

  File.open('.env', 'w') do |file|
    file.write(render_env)
    puts "Created .env"
  end

  File.open('wp-config.php', 'w') do |file|
    file.write(render_wp_config)
    puts "Created wp-config.php"
  end
end