From d8a96615ee85d77f1a65ea778ce2b061030d0f4a Mon Sep 17 00:00:00 2001 From: Doc Ritezel Date: Mon, 12 Feb 2018 20:46:30 -0800 Subject: [PATCH] Scale all worker types during a migration --- bin/deploy | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/deploy b/bin/deploy index 6aac93df55..9f6698b5ab 100755 --- a/bin/deploy +++ b/bin/deploy @@ -13,6 +13,9 @@ then fi WORKER_COUNT=$(heroku ps | grep 'worker\.' | wc -l) +SCHEDULER_COUNT=$(heroku ps | grep 'scheduler\.' | wc -l) +RECEIPTS_COUNT=$(heroku ps | grep 'receipts\.' | wc -l) +BLOCKS_COUNT=$(heroku ps | grep 'blocks\.' | wc -l) if ! git diff HEAD heroku/master --exit-code -- priv/repo then @@ -20,23 +23,23 @@ then then heroku features:disable preboot --app $HEROKU_APPLICATION heroku maintenance:on --app $HEROKU_APPLICATION - heroku scale worker=0 --app $HEROKU_APPLICATION + heroku scale worker=0 scheduler=0 receipts=0 blocks=0 --app $HEROKU_APPLICATION heroku pg:killall --app $HEROKU_APPLICATION git push heroku $CIRCLE_SHA1:refs/heads/master heroku pg:backups capture --app $HEROKU_APPLICATION heroku run "POOL_SIZE=2 mix ecto.migrate" --app $HEROKU_APPLICATION - heroku scale worker=$WORKER_COUNT --app $HEROKU_APPLICATION + heroku scale worker=${WORKER_COUNT} scheduler=${SCHEDULER_COUNT} receipts=${RECEIPTS_COUNT} blocks=${BLOCKS_COUNT} --app $HEROKU_APPLICATION heroku restart --app $HEROKU_APPLICATION heroku maintenance:off --app $HEROKU_APPLICATION heroku features:enable preboot --app $HEROKU_APPLICATION else heroku maintenance:on --app $HEROKU_APPLICATION - heroku scale worker=0 --app $HEROKU_APPLICATION + heroku scale worker=0 scheduler=0 receipts=0 blocks=0 --app $HEROKU_APPLICATION heroku pg:killall --app $HEROKU_APPLICATION git push heroku $CIRCLE_SHA1:refs/heads/master heroku pg:backups capture --app $HEROKU_APPLICATION heroku run "POOL_SIZE=2 mix ecto.migrate" --app $HEROKU_APPLICATION - heroku scale worker=$WORKER_COUNT --app $HEROKU_APPLICATION + heroku scale worker=${WORKER_COUNT} scheduler=${SCHEDULER_COUNT} receipts=${RECEIPTS_COUNT} blocks=${BLOCKS_COUNT} --app $HEROKU_APPLICATION heroku restart --app $HEROKU_APPLICATION heroku maintenance:off --app $HEROKU_APPLICATION fi