From cf08a3de6b13695a2445fa2edca467d12125bd71 Mon Sep 17 00:00:00 2001 From: tison Date: Wed, 21 Feb 2024 10:38:14 +0800 Subject: [PATCH] chore: support configure GITHUB_PROXY_URL when fetch dashboard assets (#3340) Signed-off-by: tison --- scripts/fetch-dashboard-assets.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/fetch-dashboard-assets.sh b/scripts/fetch-dashboard-assets.sh index 0a405b93ba..357980cd30 100755 --- a/scripts/fetch-dashboard-assets.sh +++ b/scripts/fetch-dashboard-assets.sh @@ -13,13 +13,20 @@ RELEASE_VERSION="$(cat $STATIC_DIR/VERSION | tr -d '\t\r\n ')" echo "Downloading assets to dir: $OUT_DIR" cd $OUT_DIR + +if [[ -z "$GITHUB_PROXY_URL" ]]; then + GITHUB_URL="https://github.com" +else + GITHUB_URL="${GITHUB_PROXY_URL%/}" +fi + # Download the SHA256 checksum attached to the release. To verify the integrity # of the download, this checksum will be used to check the download tar file # containing the built dashboard assets. -curl -Ls https://github.com/GreptimeTeam/dashboard/releases/download/$RELEASE_VERSION/sha256.txt --output sha256.txt +curl -Ls ${GITHUB_URL}/GreptimeTeam/dashboard/releases/download/$RELEASE_VERSION/sha256.txt --output sha256.txt # Download the tar file containing the built dashboard assets. -curl -L https://github.com/GreptimeTeam/dashboard/releases/download/$RELEASE_VERSION/build.tar.gz --output build.tar.gz +curl -L ${GITHUB_URL}/GreptimeTeam/dashboard/releases/download/$RELEASE_VERSION/build.tar.gz --output build.tar.gz # Verify the checksums match; exit if they don't. case "$(uname -s)" in