Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hardcode VERSION and COMMIT values in get_geth
- Loading branch information
Showing
1 changed file
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
#!/bin/bash | ||
# WARNING: the following script has a high concentration of YOLOs | ||
|
||
# Note: $HOMEDIR is defined in main.js, check it out | ||
|
||
set -e | ||
|
||
# Note: $HOMEDIR is defined in main.js, check it out | ||
HOMEDIR=${HOMEDIR:-"."} | ||
|
||
# Unfortunately GitHub ratelimits the following requests when running on travis. That's the reason why I had to hardcode the values of VERSION and COMMIT for now. | ||
# VERSION=$(curl -s https://api.github.com/repos/ethereum/go-ethereum/releases/latest | python -c "import sys, json; print(json.load(sys.stdin)['tag_name'])") | ||
# COMMIT=$(curl -s https://api.github.com/repos/ethereum/go-ethereum/commits/${VERSION} | python -c "import sys, json; print(json.load(sys.stdin)['sha'])") | ||
VERSION="1.8.27" | ||
COMMIT="4bcc0a37" | ||
PLATFORM=$(uname | tr '[:upper:]' '[:lower:]') | ||
ARCH=$(uname -m) | ||
|
||
VERSION=$(curl -s https://api.github.com/repos/ethereum/go-ethereum/releases/latest | python -c "import sys, json; print(json.load(sys.stdin)['tag_name'])") | ||
COMMIT=$(curl -s https://api.github.com/repos/ethereum/go-ethereum/commits/${VERSION} | python -c "import sys, json; print(json.load(sys.stdin)['sha'])") | ||
NAME="geth-${PLATFORM}-amd64-${VERSION:1}-${COMMIT:0:8}" | ||
NAME="geth-${PLATFORM}-amd64-${VERSION}-${COMMIT}" | ||
DOWNLOAD_URL="https://gethstore.blob.core.windows.net/builds/${NAME}.tar.gz" | ||
TMP_FILE=$(mktemp) | ||
|
||
echo "Downloading ${DOWNLOAD_URL}" | ||
curl --fail ${DOWNLOAD_URL} | tar -Oxzf - ${NAME}/geth > ${TMP_FILE} | ||
mv ${TMP_FILE} ${HOMEDIR}/geth | ||
chmod +x ${HOMEDIR}/geth |