-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathstart.sh
executable file
·41 lines (30 loc) · 1.01 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
#!/usr/bin/env bash
set -eu
set +x
scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
echo "Purging Azure Storage..."
(cd ${scriptDir}/admin && yarn purgestorage)
echo "Installing service bus..."
cd ${scriptDir}/deploy/service-bus && yarn install --frozen-lockfile
echo "Purging Service Bus..."
(cd ${scriptDir}/deploy/service-bus && yarn deleteqs)
(cd ${scriptDir}/deploy/service-bus && yarn createqs)
echo "Starting docker..."
docker-compose up -d
echo -n "Stabilising MS SQL Server"
for i in $(seq 1 8); do
sleep 1
if docker exec -it mtc_mssql /opt/mssql-tools/bin/sqlcmd -U SA -P 'Mtc-D3v.5ql_S3rv3r' -Q 'SELECT "database_is_up"' | grep -q database_is_up; then
echo " done"
break
fi
echo -n "."
done
echo ""
echo "Resetting terminal..."
command -v reset >/dev/null 2>&1 && reset
echo "Running migrations..."
(cd ${scriptDir}/db && yarn install --frozen-lockfile && yarn migrate)
echo "Running seeds..."
(cd ${scriptDir}/db && yarn seed)
echo "MTC Infrastructure ready!"