Update Heroku Release to Migrate and Load App (#5404) [deploy]
This commit is contained in:
parent
64ca1e7638
commit
9dc1f51a79
3 changed files with 12 additions and 6 deletions
2
Procfile
2
Procfile
|
|
@ -1,4 +1,4 @@
|
|||
release: STATEMENT_TIMEOUT=180000 bundle exec rails db:migrate
|
||||
release: ./release-tasks.sh
|
||||
web: bin/start-pgbouncer bundle exec puma -C config/puma.rb
|
||||
worker: bundle exec rails jobs:work
|
||||
sidekiq_worker: bundle exec sidekiq -t 25
|
||||
|
|
|
|||
|
|
@ -37,10 +37,13 @@ Upon deploy, the app installs dependencies, bundles assets, and gets the app
|
|||
ready for launch. However, before it launches and releases the app Heroku runs a
|
||||
release script on a one-off dyno. If that release script/step succeeds the new
|
||||
app is released on all of the dynos. If that release script/step fails then the
|
||||
deploy is halted and we are notified. During this release step, we have chosen
|
||||
to run migrations. This ensures that a migration finishes successfully before
|
||||
the code that uses it goes live. We deploy asynchronously, so the website is
|
||||
running the new code a few minutes after deploy. A new instance of Heroku Rails
|
||||
console will immediately run a new code.
|
||||
deploy is halted and we are notified. During this release step, we first run any
|
||||
outstanding migrations. This ensures that a migration finishes successfully
|
||||
before the code that uses it goes live. After running migrations, we use the
|
||||
rails runner to output a simple string. Executing a Rails runner command allows
|
||||
us to ensure that we can boot up the entire app successfully before it is
|
||||
deployed. We deploy asynchronously, so the website is running the new code a few
|
||||
minutes after deploy. A new instance of Heroku Rails console will immediately
|
||||
run a new code.
|
||||
|
||||

|
||||
|
|
|
|||
3
release-tasks.sh
Executable file
3
release-tasks.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
STATEMENT_TIMEOUT=180000 bundle exec rails db:migrate && rails runner "puts 'app load success'"
|
||||
Loading…
Add table
Reference in a new issue