forked from dt-orders/keptn-orders-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3-provisionInfrastructure.sh
executable file
·59 lines (50 loc) · 1.47 KB
/
3-provisionInfrastructure.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# load in the shared library and validate argument
source ./deploymentArgument.lib
DEPLOYMENT=$1
validate_deployment_argument $DEPLOYMENT
if ! [ "$2" == "skip" ]; then
clear
fi
START_TIME=$(date)
case $DEPLOYMENT in
eks)
./provisionEks.sh $2
EKS_DOMAIN=$(cat creds.json | jq -r '.eksDomain')
EKS_ELB=$(kubectl get svc istio-ingressgateway -n istio-system -o=json | jq -r '.status.loadBalancer.ingress[0].hostname')
echo "-------------------------------------------------------"
echo "Update your AWS Route 53 DNS alias to this ELB Public External IP"
echo "EKS_DOMAIN : $EKS_DOMAIN"
echo "EKS_ELB : $EKS_ELB"
echo "-------------------------------------------------------"
read -rsp $'Press ctrl-c to abort. Press any key to continue...\n' -n1 key
;;
aks)
./provisionAks.sh $2
;;
gke)
./provisionGke.sh $2
;;
*)
echo "Deploy for $DEPLOYMENT not supported"
exit 1
;;
esac
if [[ $? != 0 ]]; then
echo ""
echo "ABORTING due to provisioning error"
exit 1
fi
# adding some sleep for validateKubectl sometimes fails, if cluster not fully ready
sleep 20
echo "===================================================="
echo "Finished provisioning $DEPLOYMENT_NAME Cluster"
echo "===================================================="
echo "Script start time : $START_TIME"
echo "Script end time : "$(date)
# validate that have kubectl configured first
./validateKubectl.sh
if [ $? -ne 0 ]
then
exit 1
fi