[11.x] Add DeploymentFinish command#51993
Conversation
|
Additionally we could add output/status messages to the Event to let the user know which services have been restarted. |
|
Want to draft this for a bit because we're working on things in areas related to this and want to see where we land first. |
|
Wouldn't it be better to give it a name on what is does, e.g. |
It is meant to be a simple event emitter (for third-party purposes) |
|
Yeah it could also be just |
|
Something similar could also be extended to the |
Not sure if this is still relevant. Added a simpler patch in #57923 |
Issue
Currently, each 'service' has its own restart command:
php artisan reverb:restart
php artisan octane:reload
php artisan queue:restart
php artisan horizon:terminate
php artisan pulse:restart
Deploy scrips (either with Laravel Forge, something like Capistrano/Deployer) can be somewhat easily updated, but easy to forget. Manual deployments (eg. git pull) make it even more easy to forget one of those, leading to weird behavior.
Proposal
I propose a php artisan deploy:finish (or deploy / restart) command to reload all those services at once. Each service should be responsible for registering itself to this reload command. This can be either:
Something similar is done with php artisan optimize although this one is not configurable. This makes it easy for deploy scripts to just add php artisan reload and not worry about specific services.
I currently named it
deploy:finishjust in case we would perhaps want to add adeploy:startcommand also.Only queue is covered in this PR. Rest would go to their own repo.
(as discussed in #50900)