forked from edgexfoundry/blackbox-testing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy-edgeX.sh
executable file
·142 lines (110 loc) · 3.29 KB
/
deploy-edgeX.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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/bin/bash
# Copyright 2017 Konrad Zapalowicz <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Start EdgeX Foundry services in right order, as described:
# https://wiki.edgexfoundry.org/display/FA/Get+EdgeX+Foundry+-+Users
#if [ "${OS}" == "Windows_NT" ] ; then
# echo " os = ${OS}"
# . $(dirname "$0")/bin/env-win10.sh
#else
# . $(dirname "$0")/bin/env.sh
#fi
if [ -n "${COMPOSE_FILE_PATH}" ] && [ -r "${COMPOSE_FILE_PATH}" ]; then
COMPOSE_FILE=${COMPOSE_FILE_PATH}
else
sh ./sync.sh
COMPOSE_FILE=$(ls $(dirname "$0") | awk '/docker-compose/ && !/test-tools/')
fi
run_service () {
echo -e "\033[0;32mStarting.. $1\033[0m"
docker-compose -f $COMPOSE_FILE up -d $1
}
if [ "$SECURITY_SERVICE_NEEDED" = "true" ]; then
export SECURITY_IS_ON="true"
else
export SECURITY_IS_ON="false"
fi
run_service volume
run_service consul
if [ "$SECURITY_SERVICE_NEEDED" = "true" ]; then
run_service security-secrets-setup
run_service vault
sleep 20s
run_service vault-worker
run_service kong-db
sleep 10s
run_service kong-migrations
sleep 10s
run_service kong
sleep 20s
run_service edgex-proxy
fi
# [Workaround] there is no docker-compose-nexus-redis.yml now
if [ "$SECURITY_SERVICE_NEEDED" = true ]; then
DATABASE=mongo
fi
if [ "${DATABASE:=redis}" = redis ]; then
run_service redis
else
run_service mongo
fi
run_service logging
run_service data
run_service app-service-rules
run_service notifications
run_service metadata
run_service command
run_service scheduler
run_service system
run_service device-virtual
echo "------- volume ------"
docker logs edgex-files
echo "------- consul ------"
docker logs edgex-core-consul
echo "------- secrity-secrets-setup ------"
docker logs edgex-secrets-setup
echo "------- vault ------"
docker logs edgex-vault
echo "------- vault-worker ------"
docker logs edgex-vault-worker
echo "------- kong-db ------"
docker logs kong-db
echo "------- kong-migrations ------"
docker logs kong-migrations
echo "------- kong ------"
docker logs kong
echo "------- edgex-proxy ------"
docker logs edgex-proxy
echo "------- ${DATABASE} ------"
docker logs edgex-${DATABASE}
echo "------- logging ------"
docker logs edgex-support-logging
echo "------- data ------"
docker logs edgex-core-data
echo "------- notifications ------"
docker logs edgex-support-notifications
echo "------- metadata ------"
docker logs edgex-core-metadata
echo "------- command ------"
docker logs edgex-core-command
echo "------- scheduler ------"
docker logs edgex-support-scheduler
echo "------- edgex-sys-mgmt-agent ------"
docker logs edgex-sys-mgmt-agent
echo "------- device-virtual ------"
docker logs edgex-device-virtual
echo "------- app-service-rules ------"
docker logs edgex-app-service-configurable-rules
echo "---------------------------------------------------------"