Skip to content

ci: cache client bundle on server builds

Warren Gifford requested to merge devx/server-galore into main

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

  1. Build the server image on CI (cache miss)
  2. Build the server image on CI again (cache hit)
  3. Pull the docker image locally and run it
  4. 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)

Merge request reports

Loading