CircleCI: Upgrade shellcheck to v0.7.1 and pin version (#23815)

* CircleCI: Upgrade shellcheck to v0.7.1 and pin version

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen 2020-04-23 12:22:51 +02:00 committed by GitHub
parent 3d89f04562
commit f4d40224f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -204,7 +204,12 @@ jobs:
- run: - run:
name: Install ShellCheck name: Install ShellCheck
command: | command: |
sudo apt-get update && sudo apt-get install -y shellcheck VERSION=0.7.1
CHKSUM=beca3d7819a6bdcfbd044576df4fc284053b48f468b2f03428fe66f4ceb2c05d9b5411357fa15003cb0311406c255084cf7283a3b8fce644c340c2f6aa910b9f
curl -fLO http://storage.googleapis.com/grafana-downloads/ci-dependencies/shellcheck-v${VERSION}.linux.x86_64.tar.xz
echo $CHKSUM shellcheck-v${VERSION}.linux.x86_64.tar.xz | sha512sum --check --strict --status
tar xf shellcheck-v${VERSION}.linux.x86_64.tar.xz
sudo mv shellcheck-v${VERSION}/shellcheck /usr/local/bin/
- run: - run:
name: ShellCheck name: ShellCheck
command: | command: |

View File

@ -8,7 +8,7 @@ for ((i = 1; i <= $#; i++ )); do
remainder="${!i}" remainder="${!i}"
# Find everything until last = character (= is included in the result) # Find everything until last = character (= is included in the result)
# This allows to add tags to metric names # This allows to add tags to metric names
metricName=$(grep -o "\(.*\)=" <<< $remainder) metricName=$(grep -o "\(.*\)=" <<< "$remainder")
# Get the metric value # Get the metric value
value=${remainder#"$metricName"} value=${remainder#"$metricName"}
# Remove remaining = character from metric name # Remove remaining = character from metric name