-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathmyhero-scale-demo.sh
executable file
·40 lines (32 loc) · 1.37 KB
/
myhero-scale-demo.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
35
36
37
38
39
#!/usr/bin/env bash
echo
echo "Thank you for using the MyHero Demo Application."
echo "This script will allow you to scale the UI and App Services. "
echo
echo "Press Enter to continue..."
read confirm
echo
[ -z "${MANTL_CONTROL}" ] && echo "Please run 'source myhero_setup' to set Environment Variables" && exit 1;
[ -z "${MANTL_USER}" ] && echo "Please run 'source myhero_setup' to set Environment Variables" && exit 1;
[ -z "${MANTL_PASSWORD}" ] && echo "Please run 'source myhero_setup' to set Environment Variables" && exit 1;
[ -z "${MANTL_DOMAIN}" ] && echo "Please run 'source myhero_setup' to set Environment Variables" && exit 1;
[ -z "${DEPLOYMENT_NAME}" ] && echo "Please run 'source myhero_setup' to set Environment Variables" && exit 1;
echo "How many UI instances do you want?"
read ui_count
echo "How many App instances do you want?"
read app_count
echo "You want ${ui_count} UI instances and ${app_count} App instances."
echo "Scaling UI Service."
curl -k -X PUT -u ${MANTL_USER}:${MANTL_PASSWORD} https://${MANTL_CONTROL}/v2/apps/${DEPLOYMENT_NAME}/ui \
-H "Content-type: application/json" \
-d "{\"instances\": ${ui_count}}"
echo
echo "Done"
echo
echo "Scaling App Service."
curl -k -X PUT -u ${MANTL_USER}:${MANTL_PASSWORD} https://${MANTL_CONTROL}/v2/apps/${DEPLOYMENT_NAME}/app \
-H "Content-type: application/json" \
-d "{\"instances\": ${app_count}}"
echo
echo "Done"
echo