mirror of https://github.com/grafana/grafana
Typescript: Fixing typescript strict error, and separate check from publishing (#29679)
* Typescript: Fixing typescript string error, and seperate check from publishing * now should passpull/29683/head
parent
9668c172b3
commit
a7afab4b8a
@ -0,0 +1,13 @@ |
||||
#!/bin/bash |
||||
set -e |
||||
|
||||
echo -e "Collecting code stats (typescript errors & more)" |
||||
|
||||
ERROR_COUNT_LIMIT=579 |
||||
ERROR_COUNT="$(./node_modules/.bin/tsc --project tsconfig.json --noEmit --strict true | grep -oP 'Found \K(\d+)')" |
||||
|
||||
if [ "$ERROR_COUNT" -gt $ERROR_COUNT_LIMIT ]; then |
||||
echo -e "Typescript strict errors $ERROR_COUNT exceeded $ERROR_COUNT_LIMIT so failing build" |
||||
exit 1 |
||||
fi |
||||
|
||||
@ -1,28 +0,0 @@ |
||||
#!/bin/bash |
||||
|
||||
echo "Publishing CI Metrics" |
||||
|
||||
data="" |
||||
|
||||
for ((i = 1; i <= $#; i++ )); do |
||||
remainder="${!i}" |
||||
# Find everything until last = character (= is included in the result) |
||||
# This allows to add tags to metric names |
||||
metricName=$(grep -o "\(.*\)=" <<< "$remainder") |
||||
# Get the metric value |
||||
value=${remainder#"$metricName"} |
||||
# Remove remaining = character from metric name |
||||
metricName=${metricName%?}; |
||||
|
||||
|
||||
if [ -n "$data" ]; then |
||||
data="$data," |
||||
fi |
||||
data=''$data'{"name": "'${metricName}'", "value": '${value}', "interval": 60, "mtype": "gauge", "time": '$(date +%s)'}' |
||||
done |
||||
|
||||
echo "Publishing metrics:" |
||||
echo "$data" |
||||
curl "https://6371:$GRAFANA_MISC_STATS_API_KEY@graphite-us-central1.grafana.net/metrics" \ |
||||
-H 'Content-type: application/json' \ |
||||
-d "[$data]" |
||||
Loading…
Reference in new issue