Fund solana-install deployments from the mint keypair to avoid airdrops (#4997)

This commit is contained in:
Michael Vines
2019-07-09 16:45:28 -07:00
committed by GitHub
parent 0a949677f0
commit 32b55e6703
3 changed files with 23 additions and 10 deletions

View File

@ -5,6 +5,17 @@
set -e
SOLANA_ROOT="$(cd "$(dirname "$0")"/..; pwd)"
maybeKeypair=
while [[ ${1:0:2} = -- ]]; do
if [[ $1 = --keypair && -n $2 ]]; then
maybeKeypair="$1 $2"
shift 2
else
echo "Error: Unknown option: $1"
exit 1
fi
done
URL=$1
TAG=$2
OS=${3:-linux}
@ -60,8 +71,12 @@ esac
PATH="$SOLANA_ROOT"/target/debug:$PATH
set -x
balance=$(solana-wallet --url "$URL" balance)
# shellcheck disable=SC2086 # Don't want to double quote $maybeKeypair
balance=$(solana-wallet $maybeKeypair --url "$URL" balance)
if [[ $balance = "0 lamports" ]]; then
solana-wallet --url "$URL" airdrop 42
# shellcheck disable=SC2086 # Don't want to double quote $maybeKeypair
solana-wallet $maybeKeypair --url "$URL" airdrop 42
fi
solana-install deploy --url "$URL" "$DOWNLOAD_URL" update_manifest_keypair.json
# shellcheck disable=SC2086 # Don't want to double quote $maybeKeypair
solana-install deploy $maybeKeypair --url "$URL" "$DOWNLOAD_URL" update_manifest_keypair.json