A
A
Alexander Apokin2017-02-08 04:09:31
Composer
Alexander Apokin, 2017-02-08 04:09:31

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

2 answer(s)
V
Vyacheslav Plisko, 2017-02-08
@apokin

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 &');

S
Stanislav Pochepko, 2017-02-08
@DJZT

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 question

Ask a Question

731 491 924 answers to any question