ioBroker.js-controller
ioBroker.js-controller copied to clipboard
Make iobroker upgrade all run a single npm command instead of one per adapter
Currently, iobroker upgrade all
runs npm install adapter@version ...
for each adapter that needs upgrading. This causes npm to try and compile optional dependencies multiple times.
We could merge all commands into one and have npm run only once:
npm i adapter1@version1 adapter2@version2 ... --loglevel error --prefix /opt/iobroker
After that command is complete, all uploads could be done in batch.
If it fails, we should fall back to separate invocations, so that at least most of the adapters get upgraded.
Now where we have our new questionnaire we would need to ask all questions first, and after that starting to upgrade the adapters. I think this will also relax situations like https://github.com/ioBroker/ioBroker.js-controller/issues/1178
So basically, ask all questions and push all yes adapters into an array, npm install
the whole list in one command, and then upload the list.
How we can detect if a single adapter out of 20 makes problems and npm cancels? I would not do it honestly
Did you read my last comment? If the compound npm
process fails with any exit code, we can fall back to invoking them separately.