extender
extender copied to clipboard
Clean up Cocoapod cache after each build
The pod cache can grow quickly if the server gets a lot of build requests for a variety of extensions. Having a cronjob will not guarantee that we don't run out of disk. I propose that the CocoapodService.java will prune or wipe the cache after every build.
Several ideas:
- Schedule job in CocoapodsService to clean cache via command
pod cache clean --all
During cleanup all build request waits while operation is ended. 2. Cleanup pod used during the build
pod cache clean <name>
Can be problem when pod used in other build that currently running.
Personally I'd like variant 1.
Another suggestion. Make cocoapods repo update also as scheduled job that runs every hour (for example). And remove --repo-update flag from pod install command. It helps avoid errors when pod tries update repo in concurrent manner. As drawback - if user wants to user the "freshest" version of dependency - job can fail because version won't be in cache yet. I think in our case it's an acceptable drawback because user uses dependencies with pinned version and check is new version build or not before going production.
Personally I'd like variant 1.
I agree. This is probably the best way.
Make cocoapods repo update also as scheduled job that runs every hour (for example). And remove
--repo-updateflag from pod install command
Nice idea!
Maybe as the future step: it would be nice if Cron job check size (bigger or not of some limit we set) and clean only if condition met