Moonrepo support - Namespace Documentation

Getting started

To use Bazel caching in your Moonrepo builds, you can produce a configuration file using the CLI:

Configure cache access

nsc cache bazel setup -o json --cred_path /tmp/bazelcache > out.json

This command generates short-term credentials, and emits the configuration in JSON format. You can produce a workspace configuration as follows:

cat <<-EOF > workspace.yaml
unstable_remote:
  host: '`jq -r '.endpoint' out.json`'
  mtls:
    caCert: '`jq -r '.server_ca_cert' out.json`'
    clientCert: '`jq -r '.client_cert' out.json`'
    clientKey: '`jq -r '.client_key' out.json`'
EOF

Use the remote cache

moon run app:build

The workspace configuration file is picked up automatically for the next build invocation.

For details on how the remote cache works and how usage is accounted, check out the Bazel caching documentation.