diff --git a/net/remote/remote-deploy-update.sh b/net/remote/remote-deploy-update.sh index b533226aee..e1fbf519c6 100755 --- a/net/remote/remote-deploy-update.sh +++ b/net/remote/remote-deploy-update.sh @@ -34,4 +34,6 @@ loadConfigFile PATH="$HOME"/.cargo/bin:"$PATH" set -x -scripts/solana-install-deploy.sh localhost "$releaseChannel" "$updatePlatform" +scripts/solana-install-deploy.sh \ + --keypair config-local/mint-keypair.json \ + localhost "$releaseChannel" "$updatePlatform" diff --git a/scripts/solana-install-deploy.sh b/scripts/solana-install-deploy.sh index 030d0de722..30f42641d5 100755 --- a/scripts/solana-install-deploy.sh +++ b/scripts/solana-install-deploy.sh @@ -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 diff --git a/scripts/solana-install-update-manifest-keypair.sh b/scripts/solana-install-update-manifest-keypair.sh index 74b31c42a5..94159bcf48 100755 --- a/scripts/solana-install-update-manifest-keypair.sh +++ b/scripts/solana-install-update-manifest-keypair.sh @@ -1,11 +1,7 @@ #!/usr/bin/env bash # -# Convenience script to easily deploy a software update to a testnet -# -# Prerequisites: -# 1) The default keypair should have some lamports (eg, `solana-wallet airdrop 123`) -# 2) The file update_manifest_keypair.json should exist if this script is not -# run from the CI environment +# Creates update_manifest_keypair.json based on the current platform and +# environment # set -e