-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(NA): integrate build buddy with our bazel setup and remote cach…
…e for ci (#90116) (#90534) * chore(NA): simple changes on bazelrc * chore(NA): integrate bazel tools with BuildBuddy and remote cache service * chore(NA) fix bazelrc line config * chore(NA): move non auth settings out of bazelrc.auth * chore(NA): output home dir * chore(NA): load .bazelrc-ci.auth from /Users/tiagocosta dir * chore(NA): remove bazelrc auth file and append directly into home bazelrc * chore(NA): comment announce option * chore(NA): integrate build buddy metadata * chore(NA): update src/dev/ci_setup/.bazelrc-ci Co-authored-by: Tyler Smalley <tylersmalley@me.com> * chore(NA): move build metadata integation to common confdig * chore(NA): fix problem on bazel file location * chore(NA): correct sh file permissions * chore(NA): only get host on CI * chore(NA): add cores into host info on CI * chore(NA): sync with last settings to setup bazelisk tools on ci * chore(NA): sync last changes on ci setup env * chore(NA): sync settings on ci setup with the other PR * chore(NA): remove yarn export Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tyler Smalley <tylersmalley@me.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tyler Smalley <tylersmalley@me.com>
- Loading branch information
1 parent
ce89ce2
commit 3ad7814
Showing
6 changed files
with
89 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
|
||
# Inspired on https://github.com/buildbuddy-io/buildbuddy/blob/master/workspace_status.sh | ||
# This script will be run bazel when building process starts to | ||
# generate key-value information that represents the status of the | ||
# workspace. The output should be like | ||
# | ||
# KEY1 VALUE1 | ||
# KEY2 VALUE2 | ||
# | ||
# If the script exits with non-zero code, it's considered as a failure | ||
# and the output will be discarded. | ||
|
||
# Git repo | ||
repo_url=$(git config --get remote.origin.url) | ||
if [[ $? != 0 ]]; | ||
then | ||
exit 1 | ||
fi | ||
echo "REPO_URL ${repo_url}" | ||
|
||
# Commit SHA | ||
commit_sha=$(git rev-parse HEAD) | ||
if [[ $? != 0 ]]; | ||
then | ||
exit 1 | ||
fi | ||
echo "COMMIT_SHA ${commit_sha}" | ||
|
||
# Git branch | ||
repo_url=$(git rev-parse --abbrev-ref HEAD) | ||
if [[ $? != 0 ]]; | ||
then | ||
exit 1 | ||
fi | ||
echo "GIT_BRANCH ${repo_url}" | ||
|
||
# Tree status | ||
git diff-index --quiet HEAD -- | ||
if [[ $? == 0 ]]; | ||
then | ||
tree_status="Clean" | ||
else | ||
tree_status="Modified" | ||
fi | ||
echo "GIT_TREE_STATUS ${tree_status}" | ||
|
||
# Host | ||
if [ "$CI" = "true" ]; then | ||
host=$(hostname | sed 's|\(.*\)-.*|\1|') | ||
cores=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}' ) | ||
if [[ $? != 0 ]]; | ||
then | ||
exit 1 | ||
fi | ||
echo "HOST ${host}-${cores}" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters