-
Notifications
You must be signed in to change notification settings - Fork 4
/
up.sh
executable file
·69 lines (56 loc) · 1.75 KB
/
up.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
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
set -e
source src/helpers/logger.sh;
source src/helpers/check-deps.sh;
source src/helpers/up/usage.sh;
source src/helpers/up/init-args.sh; # contains a cluster dependency
source src/helpers/init-vars.sh;
source src/helpers/up/check-tyk-release.sh;
source src/helpers/expose-services.sh;
source src/helpers/summary.sh;
source src/helpers/helpers.sh;
if $dryRun; then
source src/helpers/dry-run.sh;
fi
mode=$@
TYKSTACK="tyk-stack";
TYKCP="tyk-cp";
TYKDP="tyk-dp";
TYKGATEWAY="tyk-gateway";
if [[ $TYKSTACK != "$mode" ]] && [[ $TYKCP != "$mode" ]] && [[ $TYKDP != "$mode" ]] && [[ $TYKGATEWAY != "$mode" ]]; then
logger "$ERROR" "invalid selection";
usage; exit 1;
fi
if [ "$AWS" == "$cloud" ] || [ "$GCP" == "$cloud" ] || [ "$AZURE" == "$cloud" ]; then
logger "$INFO" "standing up $cloud k8s cluster. This may take 10-30 minutes depending on the cloud provider...";
source src/helpers/up/tf-apply.sh;
fi
source src/helpers/up/check-vars.sh;
source src/helpers/up/update-helm.sh;
source src/main/namespace.sh;
protocol="http";
if [ "$SSL" == "$SSLMode" ]; then
protocol="https";
source src/main/ssl/main.sh;
fi
logger "$INFO" "installing $mode in $flavor k8s environment";
source src/main/redis/main.sh;
source "src/main/load-balancer.sh";
source "src/main/ingress.sh";
source "src/main/$mode.sh";
if ! [[ -z $deployments ]]; then
for deployment in "${deployments[@]}"; do
if [[ -f "src/deployments/$deployment/main.safe.sh" ]]; then
source "src/deployments/$deployment/main.safe.sh";
else
logger "$INFO" "deployment $deployment not found...skipping";
fi
done
# Update tyk installation after some configuration might have been changed.
upgradeTyk;
fi
if ! $dryRun; then
sleep $portsWait;
fi
exposeServices;
printSummaries;