Skip to content

Commit 3056372

Browse files
author
Tyler Smalley
committed
[ci] Explicitly enable writing Bazel cache
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
1 parent fda421f commit 3056372

File tree

3 files changed

+8
-30
lines changed

3 files changed

+8
-30
lines changed

.buildkite/scripts/common/setup_bazel.sh

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,10 @@ source .buildkite/scripts/common/util.sh
55
KIBANA_BUILDBUDDY_CI_API_KEY=$(retry 5 5 vault read -field=value secret/kibana-issues/dev/kibana-buildbuddy-ci-api-key)
66
export KIBANA_BUILDBUDDY_CI_API_KEY
77

8-
cp "$KIBANA_DIR/src/dev/ci_setup/.bazelrc-ci" "$HOME/.bazelrc"
8+
cp "$KIBANA_DIR/src/dev/ci_setup/.bazelrc-ci" "$KIBANA_DIR/.bazelrc"
99

1010
###
1111
### append auth token to buildbuddy into "$HOME/.bazelrc";
1212
###
13-
echo "# Appended by .buildkite/scripts/setup_bazel.sh" >> "$HOME/.bazelrc"
13+
echo "# Appended by .buildkite/scripts/setup_bazel.sh" >> "$KIBANA_DIR/.bazelrc"
1414
echo "build --remote_header=x-buildbuddy-api-key=$KIBANA_BUILDBUDDY_CI_API_KEY" >> "$HOME/.bazelrc"
15-
16-
###
17-
### remove write permissions on buildbuddy remote cache for prs
18-
###
19-
if [[ "${BUILDKITE_PULL_REQUEST:-}" && "$BUILDKITE_PULL_REQUEST" != "false" ]] ; then
20-
{
21-
echo "# Uploads logs & artifacts without writing to cache"
22-
echo "build --noremote_upload_local_results"
23-
} >> "$HOME/.bazelrc"
24-
fi

src/dev/ci_setup/.bazelrc-ci

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
# Inspired on https://github.com/angular/angular/blob/master/.circleci/bazel.linux.rc
2-
# These options are only enabled when running on CI
3-
# That is done by copying this file into "$HOME/.bazelrc" which loads after the .bazelrc into the workspace
1+
# Used in the on-merge job to persist the Bazel cache to BuildBuddy
2+
# from: .buildkite/scripts/common/setup_bazel.sh
43

5-
# Import and load bazelrc common settings for ci env
6-
try-import %workspace%/src/dev/ci_setup/.bazelrc-ci.common
4+
import %workspace%/.bazelrc.common
75

86
# BuildBuddy settings
9-
## Remote settings including cache
107
build --bes_results_url=https://app.buildbuddy.io/invocation/
118
build --bes_backend=grpcs://cloud.buildbuddy.io
129
build --remote_cache=grpcs://cloud.buildbuddy.io
1310
build --remote_timeout=3600
11+
# --remote_header=x-buildbuddy-api-key= # appended in CI script
1412

15-
## Metadata settings
13+
# Metadata settings
1614
build --build_metadata=ROLE=CI
15+
build --workspace_status_command="node ./src/dev/bazel_workspace_status.js"

src/dev/ci_setup/.bazelrc-ci.common

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)