Add -n option

This commit is contained in:
Michael Vines
2018-09-07 08:05:52 -07:00
parent d252f7f687
commit 88298bf321

View File

@ -5,6 +5,7 @@ cd "$(dirname "$0")"/..
zone= zone=
leaderAddress= leaderAddress=
clientNodeCount=0 clientNodeCount=0
validatorNodeCount=10
publicNetwork=false publicNetwork=false
snapChannel=edge snapChannel=edge
delete=false delete=false
@ -26,6 +27,7 @@ Deploys a CD testnet
options: options:
-s edge|beta|stable - Deploy the specified Snap release channel -s edge|beta|stable - Deploy the specified Snap release channel
(default: $snapChannel) (default: $snapChannel)
-n [number] - Number of validator nodes (default: $validatorNodeCount)
-c [number] - Number of client nodes (default: $clientNodeCount) -c [number] - Number of client nodes (default: $clientNodeCount)
-P - Use public network IP addresses (default: $publicNetwork) -P - Use public network IP addresses (default: $publicNetwork)
-a [address] - Set the leader node's external IP address to this GCE address -a [address] - Set the leader node's external IP address to this GCE address
@ -43,7 +45,7 @@ zone=$2
[[ -n $zone ]] || usage "Zone not specified" [[ -n $zone ]] || usage "Zone not specified"
shift 2 shift 2
while getopts "h?p:Pc:s:a:d" opt; do while getopts "h?p:Pn:c:s:a:d" opt; do
case $opt in case $opt in
h | \?) h | \?)
usage usage
@ -51,6 +53,9 @@ while getopts "h?p:Pc:s:a:d" opt; do
P) P)
publicNetwork=true publicNetwork=true
;; ;;
n)
validatorNodeCount=$OPTARG
;;
c) c)
clientNodeCount=$OPTARG clientNodeCount=$OPTARG
;; ;;
@ -80,6 +85,7 @@ done
gce_create_args=( gce_create_args=(
-a "$leaderAddress" -a "$leaderAddress"
-c "$clientNodeCount" -c "$clientNodeCount"
-n "$validatorNodeCount"
-g -g
-p "$netName" -p "$netName"
-z "$zone" -z "$zone"