Skip to content

Commit

Permalink
chore: support configure GITHUB_PROXY_URL when fetch dashboard assets (
Browse files Browse the repository at this point in the history
…#3340)

Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun authored Feb 21, 2024
1 parent f087a84 commit cf08a3d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/fetch-dashboard-assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cf08a3d

Please sign in to comment.