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