ci: cache client bundle on server builds
Created by: jhchabran
So @burmudar and I woke up this morning and we decided that the server image needed a 🧹.
Half the build time is spent building the client bundle. So we cached the client bundle
It's done in a very crude way, but it works unless proven otherwise. It checksums the /ui
, /client
folders and ./package.json
in order to build a cache key. It caches the entire /ui
folder.
It effectively shaves off about 7~9 minutes on the server
image build.
Test plan
- Build the server image on CI (cache miss)
- Build the server image on CI again (cache hit)
- Pull the docker image locally and run it
- Check that the assets are being served.
See https://buildkite.com/sourcegraph/sourcegraph/builds/161358#018211ad-d76c-40b7-b4c6-e37533ccd2d7 (18m) and https://buildkite.com/sourcegraph/sourcegraph/builds/161366#_ (8m)