diff --git a/scripts/matches/list.sh b/scripts/matches/list.sh index 64ade80..0872c2c 100755 --- a/scripts/matches/list.sh +++ b/scripts/matches/list.sh @@ -4,7 +4,7 @@ # # The usage numbers need containerInsights enabled on the cluster; without # data it says so and the task list still prints. -set -uo pipefail +set -euo pipefail source "$(dirname "$0")/../lib/aws.sh" require_aws_credentials @@ -48,7 +48,7 @@ QUERY='filter Type = "Task" query_id="$(aws logs start-query --log-group-name "$LOG_GROUP" \ --start-time $((NOW - HOURS * 3600)) --end-time "$NOW" \ - --query-string "$QUERY" --query queryId --output text 2>/dev/null)" + --query-string "$QUERY" --query queryId --output text 2>/dev/null)" || true if [ -z "$query_id" ]; then echo "no Container Insights data: the performance log group does not exist yet." @@ -59,7 +59,7 @@ fi status="" for _ in $(seq 1 15); do sleep 2 - status="$(aws logs get-query-results --query-id "$query_id" --query status --output text)" + status="$(aws logs get-query-results --query-id "$query_id" --query status --output text)" || true [ "$status" = "Complete" ] && break done [ "$status" = "Complete" ] || { echo "insights query did not complete ($status)"; exit 1; } diff --git a/scripts/matches/logs.sh b/scripts/matches/logs.sh index 2dbff6f..731e113 100755 --- a/scripts/matches/logs.sh +++ b/scripts/matches/logs.sh @@ -5,7 +5,7 @@ # host, the watchers - multiplexes onto one CloudWatch stream per task, named # match/arena/. No argument follows every task in the group; a task # id (short prefix is enough, see scripts/matches/list.sh) follows just that one. -set -uo pipefail +set -euo pipefail source "$(dirname "$0")/../lib/aws.sh" require_aws_credentials @@ -17,7 +17,7 @@ CLUSTER="$(tofu -chdir="$ENV_DIR" output -raw match_cluster_name)" LOG_GROUP="$(tofu -chdir="$ENV_DIR" output -raw match_log_group)" running="$(aws ecs list-tasks --cluster "$CLUSTER" --query 'taskArns[]' --output text \ - | tr '\t' '\n' | awk -F/ 'NF { print substr($NF, 1, 8) }' | xargs)" + | tr '\t' '\n' | awk -F/ 'NF { print substr($NF, 1, 8) }' | xargs)" || true echo "running tasks: ${running:-none}" >&2 if [ -n "$TASK" ]; then