Hi all!
It's time I address this issue: When deploying changes to production, I currently git pull and pub build on the server. (I also restart my server if any server stuff has changed, but that's irrelevant here.) The pub build kills everything in build/web and builds afresh. This means that while I'm building (a long-ish process), the assets that my server needs to serve the app are not there, and so new requests see a 404. Basically, my app is down while I pub build.
I've long thought pub build should by default build to a tmp directory, and then when done do a copy to the build/web folder. But that would still result in some downtime, as copying multiple files isn't atomic, right? If that were a good solution, I guess I could write a (grunt/gulp/pub/sh?) script that did similar?
Another option is an in-memory cache of the files – so when the server starts, read in the built assets and then if they're not found use the in-memory versions. This seems like trouble, given that there a bunch of assets (
http://d.pr/i/1j2Xy) including some static assets (though I could get those into Cloud Storage, even though some things like generic.css and mustache templates are updated here and there and I'd need to update then in GCS every time).
Keeping in mind I'm no Google, I wonder what your suggestions are?
Thank you!
--D
cc: web@, cloud@