From 86e1e3f3fed79edb28978ab10144fee766a4f589 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 26 Oct 2020 16:44:32 -0700 Subject: [PATCH] devops: collect host os name and version (#4244) Our test annotations don't provide (and don't require) a fine-grained information regarding ubuntu version, so we collect it separately. --- utils/upload_flakiness_dashboard.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/utils/upload_flakiness_dashboard.sh b/utils/upload_flakiness_dashboard.sh index 088fa43cb8..123160c5c1 100755 --- a/utils/upload_flakiness_dashboard.sh +++ b/utils/upload_flakiness_dashboard.sh @@ -44,10 +44,22 @@ export BUILD_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_ export COMMIT_SHA=$(git rev-parse HEAD) export COMMIT_TIMESTAMP=$(git show -s --format=%ct HEAD) +export HOST_OS_NAME="$(uname)" +export HOST_OS_VERSION="" +if [[ "$HOST_OS_NAME" == "Darwin" ]]; then + HOST_OS_VERSION=$(sw_vers -productVersion | grep -o '^\d\+.\d\+') +elif [[ "$HOST_OS_NAME" == "Linux" ]]; then + HOST_OS_NAME="$(bash -c 'source /etc/os-release && echo $NAME')" + HOST_OS_VERSION="$(bash -c 'source /etc/os-release && echo $VERSION_ID')" +fi + + EMBED_METADATA_SCRIPT=$(cat <