Skip to content

Commit 3c52611

Browse files
author
Matthew Fisher
committed
feat(contrib): add PREFIX option to digitalocean script
When provisioning new nodes, they are prefixed with a name of "deis-$i", where $i is the node ID. Adding a prefix option allows us to prefix the name with something other than "deis" such that we can discern between different clusters on the same DO account.
1 parent 3e7f19f commit 3c52611

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

contrib/digitalocean/provision-do-cluster.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,16 @@ CONTRIB_DIR=$(dirname $THIS_DIR)
1818
REGION_SLUG=$1
1919
SSH_ID=$2
2020
SIZE=$3
21+
PREFIX=$4
22+
23+
if [ -z "$PREFIX" ]; then
24+
PREFIX="deis"
25+
fi
2126

2227
source $CONTRIB_DIR/utils.sh
2328

2429
if [ -z "$3" ]; then
25-
echo_red 'Usage: provision-do-cluster.sh <REGION_SLUG> <SSH_ID> <SIZE>'
30+
echo_red 'Usage: provision-do-cluster.sh <REGION_SLUG> <SSH_ID> <SIZE> [PREFIX]'
2631
exit 1
2732
fi
2833

@@ -58,7 +63,7 @@ fi
5863

5964
# launch the Deis cluster on DigitalOcean
6065
i=1 ; while [[ $i -le $DEIS_NUM_INSTANCES ]] ; do \
61-
NAME=deis-$i
66+
NAME="$PREFIX-$i"
6267
echo_yellow "Provisioning ${NAME}..."
6368
docl create $NAME $BASE_IMAGE_ID $SIZE $REGION_SLUG --key=$SSH_ID --private-networking --user-data=$CONTRIB_DIR/coreos/user-data --wait
6469
((i = i + 1)) ; \

0 commit comments

Comments
 (0)