Class: DockerizeStack::Command

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions, ThorActionsExtend
Defined in:
lib/dockerize_stack.rb

Constant Summary

Constants included from ThorActionsExtend

ThorActionsExtend::CONFIG

Instance Method Summary collapse

Methods included from ThorActionsExtend

#fetch_template_variables, #run

Instance Method Details

#railsObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/dockerize_stack.rb', line 25

def rails
  run(options, :rails)
  all_file_paths(:rails).each do |file_path|
    if file_path =~ %r{./templates/rails/kubernetes} && !@kubernetes
      return false
    end

    file_name = file_path.gsub('/templates/rails', '')
    template file_name, "#{@output_folder}/#{file_name.gsub('.erb', '')}"
  end
  render_template! '.dockerignore.erb'

  puts 'Update your database.yml based in database-docker.yml'
end

#reactObject



45
46
47
48
49
50
51
52
# File 'lib/dockerize_stack.rb', line 45

def react
  run(options, :react)
  all_file_paths(:react).each do |file_path|
    file_name = file_path.gsub('/templates/react', '')
    template file_name, "#{@output_folder}/#{file_name.gsub('.erb', '')}"
  end
  render_template! '.dockerignore.erb'
end