What else are we doing?
It depends.
Uses git pull to get code on server, then runs rsync.
More flexibility, let's you choose which git commit to put live. Backs-up site.
Deploy to more than one server
server-1: deploy_code 5 seconds server-1: install_requirements 20 seconds server-1: backup_database 15 seconds server-1: migrate_database 12 seconds server-1: collectstatic 10 seconds server-1: switch_release 1 second server-1: reload_server 1 second server-2: deploy_code 5 seconds server-2: install_requirements 20 seconds server-2: backup_database 15 seconds server-2: migrate_database 12 seconds server-2: collectstatic 10 seconds server-2: switch_release 1 second server-2: reload_server 1 second
Total time to deploy = 128 seconds
Problems:
Server-2 Potential Downtime is from migrate_database starts to reload_server Server-1 Potential Downtime = 12 + 10 + 1 + 1 = 24 seconds Server-2 Potential Downtime is from migrate_database starts (on server1) to reload_server on server-2 Server-2 Potential Downtime = 64 + 24 = 88 seconds The more servers you have the longer the potential downtimes will become. Server-3 Potential Downtime = 24 + 64 + 64 = 152 seconds Server-4 Potential Downtime = 216 seconds
server-1 + 2: deploy_code 5 seconds server-1 + 2: install_requirements 20 seconds server-1 + 2: backup_database 15 seconds server-1: migrate_database 12 seconds server-1 + 2: collectstatic 10 seconds server-1 + 2: switch_release 1 second server-1 + 2: reload_server 1 second
Total time to deploy = 64 seconds
Server-1 Potential Downtime = 24 seconds Server-2 Potential Downtime = 24 seconds Server-X Potential Downtime = 24 seconds
Producer says 64 seconds is too long to have to wait to see those very important copy changes.
# Prepare deploy server-1 + 2: deploy_code 5 seconds server-1 + 2: install_requirements 20 seconds server-1 + 2: backup_database 15 seconds server-1 + 2: collectstatic 10 seconds # Activate deploy server-1: migrate_database 12 seconds server-1 + 2: switch_release 1 second server-1 + 2: reload_server 1 second
Total time to deploy = 64 seconds
Total time to activate deploy = 14 seconds
Server-1 Potential Downtime = 14 seconds Server-2 Potential Downtime = 14 seconds Server-X Potential Downtime = 14 seconds
Slides will be available online.