Make rake setup task work with Docker

This commit is contained in:
wvengen 2015-05-02 13:47:52 +02:00
parent f9cdd7f8ba
commit 27050f8b02
2 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,7 @@
.idea .idea
.sass-cache .sass-cache
log log
config/database.yml
public/assets public/assets
public/system public/system
tmp/* tmp/*

View File

@ -58,6 +58,10 @@ end
def setup_database def setup_database
file = 'config/database.yml' file = 'config/database.yml'
if ENV['DATABASE_URL']
puts blue "DATABASE_URL found, please remember to also set it when running Foodsoft"
return nil
end
return nil if skip?(file) return nil if skip?(file)
database = ask("What kind of database do you use?\nOptions:\n(1) MySQL\n(2) SQLite", ["1","2"]) database = ask("What kind of database do you use?\nOptions:\n(1) MySQL\n(2) SQLite", ["1","2"])
@ -110,6 +114,7 @@ def setup_secret_token
end end
def start_mailcatcher 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"]) mailcatcher = ask("Do you want to start mailcatcher?\nOptions:\n(y) Yes\n(n) No", ["y","n"])
if mailcatcher === "y" if mailcatcher === "y"
puts yellow "Starting mailcatcher at http://localhost:1080..." puts yellow "Starting mailcatcher at http://localhost:1080..."