mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[ci] Fixes Bazel cache writes (#114915)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
This commit is contained in:
parent
461f9f65cc
commit
5647de3b4a
5 changed files with 21 additions and 43 deletions
14
.buildkite/scripts/common/persist_bazel_cache.sh
Executable file
14
.buildkite/scripts/common/persist_bazel_cache.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
source .buildkite/scripts/common/util.sh
|
||||
|
||||
KIBANA_BUILDBUDDY_CI_API_KEY=$(retry 5 5 vault read -field=value secret/kibana-issues/dev/kibana-buildbuddy-ci-api-key)
|
||||
export KIBANA_BUILDBUDDY_CI_API_KEY
|
||||
|
||||
cp "$KIBANA_DIR/src/dev/ci_setup/.bazelrc-ci" "$KIBANA_DIR/.bazelrc"
|
||||
|
||||
###
|
||||
### append auth token to buildbuddy into "$HOME/.bazelrc";
|
||||
###
|
||||
echo "# Appended by .buildkite/scripts/persist_bazel_cache.sh" >> "$KIBANA_DIR/.bazelrc"
|
||||
echo "build --remote_header=x-buildbuddy-api-key=$KIBANA_BUILDBUDDY_CI_API_KEY" >> "$KIBANA_DIR/.bazelrc"
|
|
@ -1,24 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
source .buildkite/scripts/common/util.sh
|
||||
|
||||
KIBANA_BUILDBUDDY_CI_API_KEY=$(retry 5 5 vault read -field=value secret/kibana-issues/dev/kibana-buildbuddy-ci-api-key)
|
||||
export KIBANA_BUILDBUDDY_CI_API_KEY
|
||||
|
||||
cp "$KIBANA_DIR/src/dev/ci_setup/.bazelrc-ci" "$HOME/.bazelrc"
|
||||
|
||||
###
|
||||
### append auth token to buildbuddy into "$HOME/.bazelrc";
|
||||
###
|
||||
echo "# Appended by .buildkite/scripts/setup_bazel.sh" >> "$HOME/.bazelrc"
|
||||
echo "build --remote_header=x-buildbuddy-api-key=$KIBANA_BUILDBUDDY_CI_API_KEY" >> "$HOME/.bazelrc"
|
||||
|
||||
###
|
||||
### remove write permissions on buildbuddy remote cache for prs
|
||||
###
|
||||
if [[ "${BUILDKITE_PULL_REQUEST:-}" && "$BUILDKITE_PULL_REQUEST" != "false" ]] ; then
|
||||
{
|
||||
echo "# Uploads logs & artifacts without writing to cache"
|
||||
echo "build --noremote_upload_local_results"
|
||||
} >> "$HOME/.bazelrc"
|
||||
fi
|
|
@ -3,7 +3,7 @@
|
|||
set -euo pipefail
|
||||
|
||||
# Write Bazel cache for Linux
|
||||
.buildkite/scripts/common/setup_bazel.sh
|
||||
.buildkite/scripts/common/persist_bazel_cache.sh
|
||||
|
||||
.buildkite/scripts/bootstrap.sh
|
||||
.buildkite/scripts/build_kibana.sh
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
# Inspired on https://github.com/angular/angular/blob/master/.circleci/bazel.linux.rc
|
||||
# These options are only enabled when running on CI
|
||||
# That is done by copying this file into "$HOME/.bazelrc" which loads after the .bazelrc into the workspace
|
||||
# Used in the on-merge job to persist the Bazel cache to BuildBuddy
|
||||
# from: .buildkite/scripts/common/persist_bazel_cache.sh
|
||||
|
||||
# Import and load bazelrc common settings for ci env
|
||||
try-import %workspace%/src/dev/ci_setup/.bazelrc-ci.common
|
||||
import %workspace%/.bazelrc.common
|
||||
|
||||
# BuildBuddy settings
|
||||
## Remote settings including cache
|
||||
build --bes_results_url=https://app.buildbuddy.io/invocation/
|
||||
build --bes_backend=grpcs://cloud.buildbuddy.io
|
||||
build --remote_cache=grpcs://cloud.buildbuddy.io
|
||||
build --remote_timeout=3600
|
||||
# --remote_header=x-buildbuddy-api-key= # appended in CI script
|
||||
|
||||
## Metadata settings
|
||||
# Metadata settings
|
||||
build --build_metadata=ROLE=CI
|
||||
build --workspace_status_command="node ./src/dev/bazel_workspace_status.js"
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
# Inspired on https://github.com/angular/angular/blob/master/.circleci/bazel.common.rc
|
||||
# Settings in this file should be OS agnostic
|
||||
|
||||
# Don't be spammy in the logs
|
||||
build --noshow_progress
|
||||
|
||||
# More details on failures
|
||||
build --verbose_failures=true
|
||||
|
||||
## Avoid to keep connections to build event backend connections alive across builds
|
||||
build --keep_backend_build_event_connections_alive=false
|
Loading…
Add table
Add a link
Reference in a new issue