mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
get required versions dynamically from .promu.yml and .nvmrc
This commit is contained in:
parent
000fa45aca
commit
0c32c8c4d7
|
@ -1,9 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Required minimum versions.
|
# Required minimum versions.
|
||||||
REQUIRED_GO_VERSION="1.17"
|
REQUIRED_GO_VERSION=$(grep 'version:' .promu.yml | awk '{print $2}')
|
||||||
REQUIRED_NODE_VERSION="16.0.0"
|
REQUIRED_NODE_VERSION=$(cat web/ui/.nvmrc | tr -d '\r' | sed 's/v//')
|
||||||
REQUIRED_NPM_VERSION="7.0.0"
|
|
||||||
|
|
||||||
# Function to compare versions (checks if version A >= version B).
|
# Function to compare versions (checks if version A >= version B).
|
||||||
compare_versions() {
|
compare_versions() {
|
||||||
|
@ -47,13 +46,4 @@ else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check npm version.
|
|
||||||
NPM_VERSION=$(npm -v)
|
|
||||||
if compare_versions "$NPM_VERSION" "$REQUIRED_NPM_VERSION"; then
|
|
||||||
echo "npm version $NPM_VERSION is OK"
|
|
||||||
else
|
|
||||||
echo "npm version $NPM_VERSION is too old, required >= $REQUIRED_NPM_VERSION"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "All versions are correct."
|
echo "All versions are correct."
|
||||||
|
|
Loading…
Reference in a new issue