-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdeploy-test-instances.sh
executable file
·34 lines (26 loc) · 1.69 KB
/
deploy-test-instances.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
set -e
if [ -z "${CLONESQUAD_DIR}" ] ; then
echo "Please define CLONESQUAD_DIR environment variable!" ; exit 1
fi
source ${CLONESQUAD_DIR}/scripts/_source-me.sh
FLEET_SPECIFICATION=${FLEET_SPECIFICATION:-"t3.medium,Spot=True,Count=3;c5.large,Spot=True,Count=4;c5.large,Count=8;c5.xlarge,Count=5"}
STATIC_FLEET_SPECIFICATION=${STATIC_FLEET_SPECIFICATION:-"t3.micro,Spot=True,Count=2,SubFleetName=MySubfleet1;t3.micro,Count=2,SubFleetName=MySubfleet1;t3.micro,Count=2,SubFleetName=MySubfleet2"}
STATIC_FLEET_RDS_SPECIFICATION=${STATIC_FLEET_RDS_SPECIFICATION:-"aurora-postgresql,Count=2,SubFleetName=MySubfleet3;mysql,Count=2,SubFleetName=MySubfleet1,Storage=10,DBClass=db.t3.micro"}
demo_run_dir=${CLONESQUAD_PARAMETER_DIR}/demo/instance-fleet
mkdir -p $demo_run_dir
TemplatefileName="$demo_run_dir/template-generated.yaml"
${CLONESQUAD_DIR}/.venv/bin/python3 ./generate-env.py --specs $FLEET_SPECIFICATION --subfleet-specs $STATIC_FLEET_SPECIFICATION \
--subfleet-rds-specs $STATIC_FLEET_RDS_SPECIFICATION | tee $TemplatefileName
aws cloudformation deploy --template-file $TemplatefileName --stack-name "CS-Demo-TestEC2nRDSInstances-$GroupName$1" --capabilities CAPABILITY_IAM \
--parameter-overrides $(get_parameters) GroupName=$GroupName \
--s3-bucket $s3_bucket --s3-prefix $s3_prefix/demo-instance-fleet/
cat <<EOF
Stack ready!
Optionaly, please consider activating Vertical Scaling with 'demo-loadbalancers' demonstration
to experience smart management of instance types!
***** IMPORTANT *****
# To activate Vertical Scaling copy/paste this:
${CLONESQUAD_DIR}/tools/cs-kvtable CloneSquad-${GroupName}-Configuration import <configure-ligthhouse-instance.yaml
***** IMPORTANT *****
EOF