Skip to content

Commit 8048809

Browse files
committed
Fixed issues
1 parent f5f260d commit 8048809

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ydb/tests/tools/kqprun/scripts/start_grafana.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ docker container ls --filter name=$CONTAINER_NAME
3131

3232
echo "Wait grafana is up"
3333

34-
bash -ceux "while ! nc -v -z -w 1 localhost $2 ; do sleep 2 ; done"
34+
(set -eux; while ! nc -v -z -w 1 localhost $2; do sleep 2; done)
3535

3636
echo "Initialization of datasource and dashboards"
3737

@@ -40,9 +40,9 @@ GRAFANA_API="http://admin:admin@localhost:$2/api"
4040
curl -X POST -H "Content-Type: application/json" ${GRAFANA_API}/datasources --data-ascii "{ \"name\": \"prometheus_datasource_$1\", \"type\": \"prometheus\", \"url\": \"http://localhost:$1\", \"access\": \"proxy\" }"
4141
curl -X POST -H "Content-Type: application/json" ${GRAFANA_API}/folders --data-ascii '{ "uid": "ydb", "title": "YDB" }'
4242

43-
for DASHBOARDS_PATH in $DASHBOARDS_DIRS; do
44-
for DASH in $(ls $DASHBOARDS_PATH); do
45-
cat $DASHBOARDS_PATH/${DASH} | jq '{ folderUid: "ydb", dashboard: . }' | curl -X POST -H "Content-Type: application/json" ${GRAFANA_API}/dashboards/db -d @-
43+
for DASHBOARDS_DIR in $DASHBOARDS_DIRS; do
44+
for DASH in "$DASHBOARDS_DIR"/*; do
45+
jq '{ folderUid: "ydb", dashboard: . }' < "$DASH" | curl -X POST -H "Content-Type: application/json" ${GRAFANA_API}/dashboards/db -d @-
4646
done
4747
done
4848

0 commit comments

Comments
 (0)