-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Heroku preboot, speed up production deploys. (#1366)
This adds support for Heroku preboot. If it's enabled, we don't enter maintenance mode at all, resulting in a zero-downtime deploy; otherwise, we behave as normal, entering maintenance mode before doing any migrations. This basically means that we need to disable preboot if we ever make any migrations that will cause the old version of the code to crash. Once we've successfully done a deploy with Preboot, I'll update our Deployment wiki page with new instructions. **It also prevents tests from being run on the `production` branch.** This is a bit of a bold move but I've provided the rationale in a comment in our `circle.yml`. ``` # This is a bit counter-intuitive, but we've been extremely # diligent about only pushing to production once something # has been verified to pass CI on master. Because of this, # it's wasted effort to run the exact same tests on production # when we push to it, particularly since the merge on # production is a fast-forward merge and therefore represents # the exact same code that's already been tested on master. ``` Taken together, both changes should make deploys to production much faster without introducing risk.
- Loading branch information
Showing
5 changed files
with
108 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
project/tests/test_deploy_snapshots/heroku_with_preboot.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Running "docker build -f Dockerfile.web -t registry.heroku.com/boop/web --build-arg GIT_REVISION=e7408710b8d091377041cfbe4c185931a214f280 --build-arg IS_GIT_REPO_PRISTINE=False .". | ||
Running "docker build -f Dockerfile.worker -t registry.heroku.com/boop/worker --build-arg DOCKERFILE_WEB=registry.heroku.com/boop/web /tmp/somedir". | ||
Pushing containers to Docker registry... | ||
Running "docker login --username=_ --password=00112233-aabb-ccdd-eeff-001122334455 registry.heroku.com". | ||
Running "docker push registry.heroku.com/boop/web". | ||
Running "docker push registry.heroku.com/boop/worker". | ||
Heroku preboot is enabled, proceeding with zero-downtime deploy. | ||
Running migrations... | ||
Running "docker run --rm -it -e DATABASE_URL registry.heroku.com/boop/web python manage.py migrate". | ||
Running "docker run --rm -it -e DATABASE_URL registry.heroku.com/boop/web python manage.py initgroups". | ||
Initiating Heroku release phase... | ||
Running "heroku container:release web worker -r myapp". | ||
Deploy finished. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters