This repository has been archived by the owner on Jan 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathstart.sh
119 lines (114 loc) · 4.46 KB
/
start.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
#!/bin/bash
set -e
if [[ -z "${http_proxy}" ]]; then
echo "No Proxy provided, setting http_proxy to be blank"
export http_proxy=""
fi
if [[ -z "${AWS_DIRECTORY}" ]]; then
echo "Please set AWS_DIRECTORY environment before proceeding"
exit 1;
fi
if [[ -z "${AWS_ACCOUNT_NUMBER}" ]]; then
echo "Please set AWS_ACCOUNT_NUMBER environment before proceeding"
exit 1;
fi
pushd containers
echo "$(tput setaf 6)"
echo "-------------------------------------------------------"
echo "| Building base Fidelius containers |"
echo "-------------------------------------------------------"
echo "$(tput sgr0)"
docker-compose build
popd
pushd fidelius-sdk
echo "$(tput setaf 6)"
echo "-------------------------------------------------------"
echo "| Building Fidelius sdk |"
echo "-------------------------------------------------------"
echo "$(tput sgr0)"
mvn clean install
popd
pushd demo-services/fake-account-service
echo "$(tput setaf 6)"
echo "-------------------------------------------------------"
echo "| Building Fidelius demo services |"
echo "-------------------------------------------------------"
echo "$(tput sgr0)"
mvn clean install
popd
pushd demo-services/fidelius-setup
echo "$(tput setaf 6)"
echo "-------------------------------------------------------"
echo "| Building Fidelius setup container |"
echo "-------------------------------------------------------"
echo "$(tput sgr0)"
mvn clean install
popd
pushd fidelius-service
echo "$(tput setaf 6)"
echo "-------------------------------------------------------"
echo "| Building Fidelius backend service |"
echo "-------------------------------------------------------"
echo "$(tput sgr0)"
mvn clean install
popd
pushd fidelius-ui
echo "$(tput setaf 6)"
echo "-------------------------------------------------------"
echo "| Building Fidelius UI |"
echo "-------------------------------------------------------"
echo "$(tput sgr0)"
npm install
npm run build
popd
echo "$(tput setaf 6)"
echo "-------------------------------------------------------"
echo "| Building Fidelius containers |"
echo "-------------------------------------------------------"
echo "$(tput sgr0)"
docker-compose -f setup-docker-compose.yml build
docker-compose -f local-docker-compose.yml build
echo "$(tput setaf 6)"
echo "-------------------------------------------------------"
echo "| Starting Fidelius Setup |"
echo "-------------------------------------------------------"
echo "$(tput sgr0)"
docker-compose -f setup-docker-compose.yml up
ret=$(docker wait fidelius_fidelius_setup_1)
if [[ $ret -eq 1 ]]; then
echo "$(tput setaf 1)"
echo "-------------------------------------------------------"
echo "| Error encountered running Fidelius setup |"
echo "| Please fix and try again. |"
echo "-------------------------------------------------------"
echo "$(tput sgr0)"
else
echo "$(tput setaf 6)"
echo "-------------------------------------------------------"
echo "| Starting Fidelius Local Environment |"
echo "-------------------------------------------------------"
echo "$(tput sgr0)"
docker-compose -f local-docker-compose.yml up -d
result1=$(docker container logs fidelius_fidelius-service_1)
result2=$(docker container logs fidelius_fidelius_accounts_1)
while [[ $result1 != *"Started FideliusApp"* || $result2 != *"Started FakeAccountServiceApplication"* ]]; do
echo ""
echo "Waiting for containers to start to launch browser..."
sleep 5
result1=$(docker container logs fidelius_fidelius-service_1)
result2=$(docker container logs fidelius_fidelius_accounts_1)
done
open https://localhost:443
open https://localhost:444
open https://localhost:445
echo "$(tput setaf 6)"
echo "-------------------------------------------------------"
echo "| Fidelius User Endpoints |"
echo "| |"
echo "| DEV user - https://localhost:443 |"
echo "| OPS user - https://localhost:444 |"
echo "| MASTER user - https://localhost:445 |"
echo "| |"
echo "-------------------------------------------------------"
echo "$(tput sgr0)"
fi