Improve Docker setup (PR #497)

This commit is contained in:
wvengen 2017-10-01 13:57:36 +02:00 committed by GitHub
parent 01950b48a1
commit 0363f2dadc
13 changed files with 236 additions and 108 deletions

View file

@ -33,7 +33,6 @@ namespace :foodsoft do
setup_app_config
setup_development
setup_database
setup_secret_token
start_mailcatcher
puts yellow "All done! Your foodcoft should be running smoothly."
start_server
@ -44,7 +43,6 @@ namespace :foodsoft do
task :stock_config do
setup_app_config
setup_development
setup_secret_token
end
end
end
@ -103,16 +101,6 @@ def setup_development
reminder(file)
end
def setup_secret_token
file = 'config/initializers/secret_token.rb'
return nil if skip?(file)
puts yellow "Generating secret_token and writing to #{file}..."
Rake::Task["secret"].reenable
secret = capture_stdout { Rake::Task["secret"].invoke }
%x( touch #{Rails.root.join("#{file}")}; echo 'Foodsoft::Application.config.secret_key_base = "#{secret.chomp}"' > #{Rails.root.join("#{file}")} )
end
def start_mailcatcher
return nil if ENV['MAILCATCHER_PORT'] # skip when it has an existing Docker container
mailcatcher = ask("Do you want to start mailcatcher?\nOptions:\n(y) Yes\n(n) No", ["y","n"])