Skip to content

Commit

Permalink
Merge pull request #757 from rubyforgood/enhance-docker-bootstrap
Browse files Browse the repository at this point in the history
Enhance docker bootstrap to also build webpack, email images
  • Loading branch information
solebared authored Sep 30, 2020
2 parents 8e59c53 + 1521e05 commit d625bf2
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions bin/dev/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@

set -e

function setup() {
local environment
environment="$1"

docker-compose -f docker/development/docker-compose.yml \
run --rm \
app bin/rails db:reset RAILS_ENV="${environment}"
function dc() {
docker-compose -f docker/development/docker-compose.yml run --rm "$@"
}

# start fresh
bin/dev/clean
setup development
setup test

# will create the app container, create both dev and test databases, and seed dev
dc app bin/rails db:reset

# only the test db needs to be explicitly seeded
dc app bin/rails db:seed RAILS_ENV=test

# build the image and make sure webpack can compile; don't start webpack-dev-server
dc webpacker bin/webpack

# build the image; don't start mailcatcher yet
dc email echo done!

0 comments on commit d625bf2

Please sign in to comment.