File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66set -e
77
8+ listcontains () {
9+ for i in $1 ; do
10+ [[ $i = $2 ]] && echo $i && return 0
11+ done
12+ return 1
13+ }
14+
815THIS_DIR=$( cd $( dirname $0 ) ; pwd) # absolute path
916CONTRIB_DIR=$( dirname $THIS_DIR )
1017
1118source $CONTRIB_DIR /utils.sh
1219
20+ if [ -z " $4 " ]; then
21+ echo_red ' Usage: provision-do-cluster.sh <REGION_ID> <IMAGE_ID> <SSH_ID> <SIZE>'
22+ exit 1
23+ fi
24+
1325# check for DO tools in $PATH
1426if ! which tugboat > /dev/null; then
1527 echo_red ' Please install the tugboat gem and ensure it is in your $PATH.'
@@ -20,6 +32,18 @@ if [ -z "$DEIS_NUM_INSTANCES" ]; then
2032 DEIS_NUM_INSTANCES=3
2133fi
2234
35+ regions_with_private_networking=(4 5 6 7)
36+ if ! listcontains " $regions_with_private_networking " " $2 " ;
37+ then
38+ echo_red " Invalid region. Please supply a region with private networking support."
39+ echo_red " Valid regions are:"
40+ echo_red " 4: New York 2"
41+ echo_red " 5: Amsterdam 2"
42+ echo_red " 6: Singapore 1"
43+ echo_red " 7: London 1"
44+ exit 1
45+ fi
46+
2347# check that the CoreOS user-data file is valid
2448$CONTRIB_DIR /util/check-user-data.sh
2549
You can’t perform that action at this time.
0 commit comments