Skip to content

Commit 8dc557f

Browse files
Add README.md for BCR mirror
Change-Id: I4e6c3af1fafde920ee1a73846effbdd13ff43017
1 parent a706784 commit 8dc557f

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

bazel/registry/modules/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# BCR Mirror
2+
This is an attempt to mirror the bazel central registry on our nexus server.
3+
4+
# How To
5+
In case an upstream resource (most likely github) is unavailable and the corresponding package is not already part of this mirror here, do the following:
6+
* create the folder structure under `bazel/registry/modules`
7+
* `{module_name}/{version}/source.json`
8+
* you can also easily copy it from [bazel-central-registry](https://github.com/bazelbuild/bazel-central-registry/tree/main/modules)
9+
* e.g. in order to get `alsa_lib` in version `1.2.0`, copy `alsa_lib/1.2.9/source.json` including the folders to `bazel/registry/modules`
10+
* afterwards upload the file from `url` to nexus's `upstream-archives`
11+
* add a field to the `source.json` which points to the nexus mirror:
12+
```
13+
"mirror_urls": {"https://artifacts.lan.tribe29.com/repository/upstream-archives/{THE_FILE_NAME_FROM_url}"}
14+
```
15+
16+
# Test the mirror
17+
* clean the repository cache:
18+
```
19+
rm -rf ~/.cache/bazel/_bazel_$(whoami)/cache/repos/v1
20+
```
21+
* clean the bazel cache:
22+
```
23+
bazel clean --expunge
24+
```
25+
* test the mirror by blocking the upstream url (e.g. by introducing a typo in the url) and do a `bazel build` which would pull that depend
26+
This should result in using the nexus url for downloading.

0 commit comments

Comments
 (0)