deployphp / deployer

The PHP deployment tool with support for popular frameworks out of the box
https://deployer.org
MIT License
10.41k stars 1.47k forks source link

M2 recipe : handle cron stop in try catch #3828

Open gbobts opened 1 month ago

gbobts commented 1 month ago

This change handle the case when cron:remove can not be executed properly, for example when setup:upgrade or Magento 2 installation wasn't done properly.

Try/Catch prevents breaking of deployment (as cron stopping is nice to have, but not required).

peterjaap commented 1 month ago

I'm not entirely sure this should be in the default recipe at all. Installing the cron is a one-off task and shouldn't occur on every deployment.

gbobts commented 1 month ago
  1. I believe stopping cron jobs while deploying is a good practice
  2. The path to bin/magento in the crontab will contain the release number while executing cron:install manually, so this path should be updated by the deployment process

So I believe this MR should be accepted