Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy Laravel, PHP upgrade #294

Open
carlschroedl opened this issue Jun 19, 2022 · 1 comment
Open

Deploy Laravel, PHP upgrade #294

carlschroedl opened this issue Jun 19, 2022 · 1 comment
Assignees

Comments

@carlschroedl
Copy link
Member

carlschroedl commented Jun 19, 2022

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
  1. Merge Upgrade to Laravel 9 #292
    Buildkite should pick up from there and take care of the rest

Troubleshooting

  • Install new dependencies, automatically regenerate caches
$ php composer install --no-interaction
...
(Installs a bunch of packages)
...
> Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize
Configuration cache cleared successfully.
Configuration cached successfully.
Route cache cleared successfully.
Routes cached successfully.
Files cached successfully.
  • Manually regenerate caches
$ php artisan optimize

Related to #292
Related to #293

@carlschroedl
Copy link
Member Author

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants