xcpretty / xcode-install

🔽 Install and update your Xcodes
https://fastlane.tools
MIT License
2.59k stars 243 forks source link

Use Cache for Downloads #198

Open mindrunner opened 7 years ago

mindrunner commented 7 years ago

Hi I am provisioning OSX virtual machines with xcode-install. One of the longer Tasks is Downloading the XCode DMGs. I want to mount a shared folder where the files can be cached, so that not every VM has to trigger the download again. I tried setting XCODE_INSTALL_CACHE_DIR, but does not seem to work. My workaround at the moment is to manually Download and use '--url=' parameter pointing to the local file. Though, it then is copied to ~/Library/Cache or somewhere before mounting. How can I improve my solution? Furthermore, how can I achieve same thing for all simulators?

loyaltyarm commented 7 years ago

Not sure of your use case, but are you able to use templates for your virtual machines? If so you could probably save time by provisioning a template and using a linked clone rather than re-provisioning each VM with xcode-install. This type of solution may not apply if you are doing this with something like VMWare Fusion.

mindrunner commented 7 years ago

Thats not really an option. I want to create fresh machines from scratch. I found some work around by mounting a shared folder into the Cache-Folder inside the VM. This seems to be working for me and I provisioning is quite a bit faster now. :)

loyaltyarm commented 7 years ago

Ah okay. You could alternatively use a server like munki to have these cached on your local network and bootstrap from that endpoint on boot of a fresh machine. Munki also allows for something similar where the resulting payload from a package check-in payload would end up in /Library/Managed Installs/Cache and you could install from there. It would be similar to your solution above, but would save you the mounting step, and add a munki tooling install into your VM provisioning. Happy to chat on the #fastlane slack team if you're around regarding your use case.

mindrunner commented 7 years ago

Cool, Thanks for pointing me to munki. Will try that out when I have more demand for it. At the moment, my solution works great for us! :)

Cheers