-
Notifications
You must be signed in to change notification settings - Fork 1
/
bagan
executable file
·102 lines (88 loc) · 2.36 KB
/
bagan
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
set -e
mode=$1
command=$2
dockerBaganInitVersion="0.1.7"
. scripts/log.sh
. scripts/command_infra.sh
. scripts/command_helm.sh
. scripts/command_bagan.sh
. scripts/command_cluster.sh
. scripts/command_secret.sh
. scripts/command_utils.sh
. scripts/command_end.sh
. scripts/mode_gcloud.sh
. scripts/mode_gcloud_docker.sh
. scripts/mode_standalone.sh
log ""
color '32;1' "Welcome to Bagan"
log "mode: $mode"
log "command: $command"
log ""
. scripts/validations.sh
if [ "$mode" == "gcloud" ]; then
requeriments=" - jq: https://stedolan.github.io/jq/
- gcloud: https://cloud.google.com/sdk/
- docker: https://www.docker.com/
- kscript: https://github.com/holgerbrandl/kscript"
elif [ "$mode" == "gcloud_docker" ]; then
requeriments=" - jq: https://stedolan.github.io/jq/
- docker: https://www.docker.com/"
elif [ "$mode" == "standalone" ]; then
requeriments=" - Setup locally kubectl in the execution machine
- kscript: https://github.com/holgerbrandl/kscript"
else
echo "error : Be sure you have included the bagan_conf.json with the desired configuration."
fi
log ""
log "Requeriments for your $mode environment selection:"
log "$requeriments"
log ""
log "Values bagan_conf.json:"
log " -mode: $mode"
log " -cluster: $cluster"
log " -zone: $zone"
log " -machine: $machine"
log " -repository: $repository"
log " -private repository: $private"
if [ "$private" == "true" ]; then
log " -ssh key path: $ssh"
log " -known hosts path: $known_hosts"
fi
log " -gradleCommand: $gradleCommand"
log " -Experiments:"
if [ "$properties" != "null" ]; then
log " -properties: $properties"
fi
if [ "$branch" != "null" ]; then
log " -branch: $branch"
fi
if [ "$gradleWrapperVersion" != "null" ]; then
log " -gradleWrapperVersion: $gradleWrapperVersion"
fi
log ""
echo -n "Do you want to continue [y/n]: "
read ans
if [ "$ans" != "y" ] || [ -z "$ans" ]; then
exit 1
fi;
log "Staring Bagan"
log "Creating tmp folder"
rm -rf tmp
mkdir tmp
log "copying charts and binaries to tmp"
cp -r k8s/grafana tmp/
cp -r k8s/influxdb tmp/
cp -r docker/installer/bin/generator tmp/
cp -r docker/pod/bin/ tmp
log "Running mode $mode"
if [ $mode == "gcloud" ]; then
gcloudExecutor
elif [ $mode == "gcloud_docker" ]; then
gcloudDockerExecutor
elif [ $mode == "standalone" ]; then
standaloneExecutor
else
error "Error: no type parsed properly "
exit 1
fi