Skip to content

Commit

Permalink
Stop running migrations on workers up (#89)
Browse files Browse the repository at this point in the history
Also, adds dependencies between containers in docker-compose.yml.

I had to split db:setup into db:create, schema:load and db:seed because for some reason that I don't understand it was failing the previous way
  • Loading branch information
lmatayoshi authored Nov 25, 2020
1 parent 125cd92 commit c22f920
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bin/app_update
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ chdir APP_ROOT do
system('bundle check') || system!('bundle install')

puts "\n== Updating database =="
system! 'bin/rails db:migrate || bin/rails db:setup'
system! 'bin/rails db:migrate || (bin/rails db:create && bin/rails db:schema:load && bin/rails db:seed)'

puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'
Expand Down
9 changes: 0 additions & 9 deletions bin/workers_update
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,4 @@ chdir APP_ROOT do
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')

puts "\n== Updating database =="
system! 'bin/rails db:migrate || bin/rails db:setup'

puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'

puts "\n== Removing assets =="
system! 'bin/rails assets:clobber'
end
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ services:
build:
context: .
dockerfile: Dockerfile-dev
depends_on:
- db
links:
- db
- cache
Expand All @@ -22,6 +24,8 @@ services:
build:
context: .
dockerfile: Dockerfile-dev
depends_on:
- app
links:
- db
- cache
Expand Down

0 comments on commit c22f920

Please sign in to comment.