-
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.
Merge branch 'master' into implement/separate-report-tasks
- Loading branch information
Showing
9 changed files
with
96 additions
and
10 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
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