pivot-libre / pivot

Pivot is a web app for conducting Ranked Pairs elections
https://pivot.vote/
Apache License 2.0
8 stars 7 forks source link

Deploy Laravel, PHP upgrade #294

Open carlschroedl opened 2 years ago

carlschroedl commented 2 years ago

Local Verification

I spun up a Homestead VM and verified that a local Pivot installation using the master branch (PHP 7.2.34, Laravel 5), can be safely updated to Oliver's branch (PHP 8.1.3, Laravel 9) without data loss, or regressions, as long as we remember to update the name of the env var that configures the mail driver. Details in Upgrade Outline.

Limitations of verification:

A. I did NOT test with Apache httpd -- I used Laravel's built-in development-grade HTTP server B. I did NOT attempt to use a MySQL version that matches what is currently on the production server -- my local tests used MySQL 8.0.28 for both the old version and the upgraded version of Pivot. C. I only verified the migration of one test election. The election had 3 candidates, 1 regular voter (the election creator), and two proxy voters (both emails were the election creator).

All that said, I think it is reasonable to proceed -- risks arising from disparities between the dev and prod environment can be mitigated by snapshotting the VM, and/or backing up the database.

Upgrade Outline

  1. Take snapshot of VM and/or make backup of MySQL database
  2. Upgrade PHP to version 8.1
  3. Rename mail env var from MAIL_DRIVER to MAIL_MAILER.
    $ sed -i 's/MAIL_DRIVER/MAIL_MAILER/' .env
  4. Merge https://github.com/pivot-libre/pivot/pull/292 Buildkite should pick up from there and take care of the rest

Troubleshooting

Related to #292 Related to #293

carlschroedl commented 2 years ago

@keithnet I think this is ready to deploy! I will send you my availability privately in case you want to coordinate a time to try this together!