Answer the question
In order to leave comments, you need to log in
How to update/verify packages automatically?
There are several projects. All of them update products from the same supplier. Parsers are packaged and can be updated via composer.
The provider makes changes to its api. And then everyone on the server needs to go to the console and update. Lots of extra steps.
How can I force them to update automatically? How it should work in my opinion:
Scheduled queue checks for updates and starts the update.
Launching/checking the update on the button from the admin panel.
It would be very nice to see the progress from the admin panel.
Questions: How to check packages? How to start updates automatically or by button?
Who faced such a task? Can eat ready decisions on this subject?
Answer the question
In order to leave comments, you need to log in
Well, there is no particular problem, you just pull the command through exec
exec('composer.phar update venrorName/packageName', $output);
The command will be fully executed and the output will be in the $output variable.
If you mess with progress in real time, then everything becomes more complicated. Again, pull through exec, just run it in the background, and redirect the output to some file from which you read the file log information with some kind of Ajax request.
exec('composer.phar update venrorName/packageName > output.log &');
It's not a good idea to do uncontrolled package upgrades. There are times when things don't go smoothly. It can be trite a minor bug that will be fixed in a couple of hours, and you have already updated. And the site has been down for a while.
I see only one way out of this situation. Do an update, but keep the working version number. If something stops working, roll back to the previous version.
And on the process itself - Vyacheslav Plisko quite clearly described.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question