From 41b25e2aa205a54b916ba987c9c0ae600204ebfd Mon Sep 17 00:00:00 2001 From: Jordan Kiley Date: Mon, 18 Mar 2019 17:53:15 -0700 Subject: [build] Add sha to the coverage json (#14145) --- scripts/code-coverage.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/code-coverage.sh b/scripts/code-coverage.sh index d6866f61b8..c58501605d 100755 --- a/scripts/code-coverage.sh +++ b/scripts/code-coverage.sh @@ -17,12 +17,16 @@ if [[ ! $2 = "iOS" && ! $2 = "Android" ]]; then exit 1 fi +circle_sha="" +if [[ $CIRCLE_SHA1 ]]; then + circle_sha="$CIRCLE_SHA1" +fi # Create a formatted JSON file that contains the current coverage. -current_date=$(TZ=UTC date +"%Y-%m-%d") +current_date=$(TZ=UTC date +"%F-%T") file_name=$2_coverage.json cat < $file_name - {"code_coverage":$1,"platform":"$2","sdk":"Maps","scheme":"$3","created_at":"$current_date"} + {"code_coverage":$1,"platform":"$2","sdk":"Maps","scheme":"$3","created_at":"$current_date","sha":"$circle_sha"} EOF gzip -f $file_name -- cgit v1.2.1