forked from dcos/demos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-services.sh
executable file
·52 lines (46 loc) · 2.08 KB
/
install-services.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
#!/usr/bin/env bash
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
# pick the first Kafka broker FQDN (note that -r strips the quotes):
broker0=`dcos kafka endpoints broker | jq -r .dns[0]`
echo deploying the fintrans generator ...
if [ "$(uname)" == "Darwin" ]; then
# replace the template with the actual value of the broker:
sed -i '.tmp' "s/BROKER/$broker0/" ./service/generator.json
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
# replace the template with the actual value of the broker:
sed -i'.tmp' "s/BROKER/$broker0/" ./service/generator.json
fi
# deploy service:
dcos marathon app add ./service/generator.json
# restore template:
mv ./service/generator.json.tmp ./service/generator.json
echo ==========================================================================
echo deploying the recent financial transactions consumer ...
if [ "$(uname)" == "Darwin" ]; then
# replace the template with the actual value of the broker:
sed -i '.tmp' "s/BROKER/$broker0/" ./service/influx-ingest.json
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
# replace the template with the actual value of the broker:
sed -i'.tmp' "s/BROKER/$broker0/" ./service/influx-ingest.json
fi
# deploy service:
dcos marathon app add ./service/influx-ingest.json
# restore template:
mv ./service/influx-ingest.json.tmp ./service/influx-ingest.json
echo ==========================================================================
echo deploying the money laundering detector ...
if [ "$(uname)" == "Darwin" ]; then
# replace the template with the actual value of the broker:
sed -i '.tmp' "s/BROKER/$broker0/" ./service/laundering-detector.json
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
# replace the template with the actual value of the broker:
sed -i'.tmp' "s/BROKER/$broker0/" ./service/laundering-detector.json
fi
# deploy service:
dcos marathon app add ./service/laundering-detector.json
# restore template:
mv ./service/laundering-detector.json.tmp ./service/laundering-detector.json
echo DONE ====================================================================