Skip to content

Commit

Permalink
Make rake setup task work with Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
wvengen committed May 2, 2015
1 parent f9cdd7f commit 27050f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Expand Up @@ -2,6 +2,7 @@
.idea
.sass-cache
log
config/database.yml
public/assets
public/system
tmp/*
Expand Down
5 changes: 5 additions & 0 deletions lib/tasks/foodsoft_setup.rake
Expand Up @@ -58,6 +58,10 @@ end

def setup_database
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)

database = ask("What kind of database do you use?\nOptions:\n(1) MySQL\n(2) SQLite", ["1","2"])
Expand Down Expand Up @@ -110,6 +114,7 @@ def setup_secret_token
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"])
if mailcatcher === "y"
puts yellow "Starting mailcatcher at http://localhost:1080..."
Expand Down

0 comments on commit 27050f8

Please sign in to comment.