Skip to content

Commit db62b05

Browse files
authored
Local bazelrc file approach for passing gcloud auth credentials (#329)
## Summary Adds support for creating a new `.bazelrc.local` file specifying custom build/test bazel options which can be used for passing gcloud auth credentials ## Checklist - [ ] Added Unit Tests - [ ] Covered by existing CI - [ ] Integration tested - [ ] Documentation update <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Updated the build configuration to optionally load a user-specific settings file, replacing the automatic use of preset credentials. - **Documentation** - Enhanced guidance with a new section detailing steps for setting up personal authentication credentials. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 23dcc24 commit db62b05

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
try-import %workspace%/.bazelrc.local
2+
13
build --java_language_version=11
24
build --java_runtime_version=11
5+
build --remote_cache=https://storage.googleapis.com/zipline-bazel-cache
36
test --test_output=errors
47
test --test_timeout=900

devnotes.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ export PATH="/usr/local/bin:${PATH}"
8080
We enabled remote caching for all our builds/tests for both local development and CI.
8181
As part of that change we would need to do gcloud auth to read/write from remote cache stored in our BigTable bucket for the local dev builds.
8282

83+
#### For passing GCloud Auth credentials to Bazel
84+
Create a new .bazelrc.local file with the following content. Also feel free to specify any local overrides to the build/test options here.
85+
This file is git-ignored.
86+
```
87+
build --google_credentials=/Users/{username}/.config/gcloud/application_default_credentials.json
88+
```
89+
8390
### Java not found error on Mac
8491

8592
In case you run into this error the fix is to manually download and install amazon corretto-17 from [here](https://docs.aws.amazon.com/corretto/latest/corretto-17-ug/downloads-list.html)

0 commit comments

Comments
 (0)