Skip to content

Commit

Permalink
add missing update on script
Browse files Browse the repository at this point in the history
Signed-off-by: Thibault Mange <[email protected]>
  • Loading branch information
thibaultmg committed Jan 10, 2025
1 parent 594f676 commit 623af54
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cicd-scripts/metrics/scripts/extract-dashboards-metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
set -e -o pipefail

if [ $# -ne 1 ]; then
echo "Usage: $0 <directory>"
exit 1
echo "Usage: $0 <directory>"
exit 1
fi

SEARCH_DIR="$1"

if [[ "$(uname)" == "Darwin" ]]; then
TMP_DIR="${TMPDIR:-/tmp}"
TMP_DIR="${TMPDIR:-/tmp}"
else
TMP_DIR="/tmp"
TMP_DIR="/tmp"
fi

OUTPUT_DIR="$TMP_DIR/grafana-dashboards"
mkdir -p "$OUTPUT_DIR"

find "$SEARCH_DIR" -name 'dash*.yaml' ! -name '*ocp311.yaml' -print0 | while IFS= read -r -d '' file; do
yq '.data | to_entries | .[0].value' "$file" > "$OUTPUT_DIR/$(basename "$file")"
yq '.data | to_entries | .[0].value' "$file" >"$OUTPUT_DIR/$(basename "$file")"
done

files=$(find "$OUTPUT_DIR" -type f -print0 | xargs -0)
Expand Down

0 comments on commit 623af54

Please sign in to comment.