From 0eb2d25570a8813032a705af6bed6d88f20905ed Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Mon, 27 Sep 2021 18:05:56 +0200 Subject: [PATCH] [skip changelog] Update workflow and script to fetch Arduino CDN download data --- .github/tools/fetch_athena_stats.sh | 118 --------------------------- .github/workflows/arduino-stats.yaml | 11 +-- 2 files changed, 6 insertions(+), 123 deletions(-) delete mode 100755 .github/tools/fetch_athena_stats.sh diff --git a/.github/tools/fetch_athena_stats.sh b/.github/tools/fetch_athena_stats.sh deleted file mode 100755 index 5459863a..00000000 --- a/.github/tools/fetch_athena_stats.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env bash - -# This script performs the following: -# 1. Run the query, use jq to capture the QueryExecutionId, and then capture that into bash variable -# 2. Wait for the query to finish running (240 seconds). -# 3. Get the results. -# 4. Json data points struct build - -# Expected env variables are: -# AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY for accessing AWS resources -# AWS_ATHENA_SOURCE_TABLE -# AWS_ATHENA_OUTPUT_LOCATION -# GITHUB_REPOSITORY - -set -euo pipefail - -loadExecutionId=$( - aws athena start-query-execution \ - --query-string "MSCK REPAIR TABLE ${AWS_ATHENA_SOURCE_TABLE};" \ - --result-configuration "OutputLocation=${AWS_ATHENA_OUTPUT_LOCATION}" \ - --region us-east-1 | jq -r ".QueryExecutionId" -) - -echo "QueryExecutionId is ${loadExecutionId}" -for i in $(seq 1 120); do - loadState=$( - aws athena get-query-execution \ - --query-execution-id "${loadExecutionId}" \ - --region us-east-1 | jq -r ".QueryExecution.Status.State" - ) - - if [[ "${loadState}" == "SUCCEEDED" ]]; then - break - fi - - echo "QueryExecutionId ${loadExecutionId} - state is ${loadState}" - - if [[ "${loadState}" == "FAILED" ]]; then - exit 1 - fi - - sleep 2 -done - -! read -r -d '' query <