From 9acdbc1424bb5deff2d681802e632b16140a7b75 Mon Sep 17 00:00:00 2001 From: Leandro Matayoshi Date: Wed, 25 Nov 2020 10:44:51 -0300 Subject: [PATCH] Stop running migrations on `workers` up 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 --- bin/app_update | 2 +- bin/workers_update | 9 --------- docker-compose.yml | 4 ++++ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/bin/app_update b/bin/app_update index de1edb5..4e8f49b 100755 --- a/bin/app_update +++ b/bin/app_update @@ -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' diff --git a/bin/workers_update b/bin/workers_update index 1533e10..f4bf77e 100755 --- a/bin/workers_update +++ b/bin/workers_update @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index eb033b8..164a58d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,8 @@ services: build: context: . dockerfile: Dockerfile-dev + depends_on: + - db links: - db - cache @@ -22,6 +24,8 @@ services: build: context: . dockerfile: Dockerfile-dev + depends_on: + - app links: - db - cache