Skip to content

Commit 276a045

Browse files
committed
fix(grafana): build grafana error
1 parent 7a95853 commit 276a045

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

stacks/grafana/build.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66
# Implement build function
77
function build() {
88
generate-stack-path
9-
curl -fsSL -o tmp.tar.gz https://dl.grafana.com/oss/release/grafana-${STACK_VERSION}.linux-${OS_ARCH}.tar.gz
9+
install-stack jq 1.7.1 && . init-stack
10+
url=$(curl -s "https://grafana.com/api/grafana/versions/${STACK_VERSION}" | \
11+
jq -r ".packages[] | select(.os == \"linux\" and (.arch == \"${OS_ARCH}\") and (.url | endswith(\".tar.gz\"))) | .url")
12+
echo "Downloading Grafana..."
13+
curl -fSL -o tmp.tar.gz "$url"
1014
tar -xzf tmp.tar.gz
11-
cp -rf grafana-v${STACK_VERSION}/* ${DATA_DIR}
15+
cp -rf grafana-${STACK_VERSION}/* ${DATA_DIR}
1216
rm -rf tmp.tar.gz grafana-${STACK_VERSION}
1317
}
1418

0 commit comments

Comments
 (0)