-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·63 lines (49 loc) · 1008 Bytes
/
build.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
#!/bin/bash
if [ -z "$1" ]; then
cd scripts
./firstaction.sh
fi
if [ "$1" = "--push" ] || [ "$1" = "-p" ]; then
if [ -z "$2" ]; then
echo "no commit message given"
exit 1
fi
cd scripts
./push.sh "$1" "$2"
cd ..
exit 1
fi
if [ "$1" = "--database" ] || [ "$1" = "-p" ]; then
cd scripts
./database.sh "$1" "$2"
cd ..
exit 1
fi
if [ "$1" = "--request" ] || [ "$1" = "-req" ]; then
cd scripts
./request.sh "$1" "$2"
cd ..
exit 1
fi
if [ "$1" = "--run" ]; then
cd scripts
lsof -t -i :4000 | xargs kill -9
./run.sh
cd ..
exit 1
fi
if [ "$1" = "--test" ]; then
lsof -t -i :4000 | xargs kill -9
cd scripts
./run.sh &
cd ..
echo "Waiting for the server to start..."
sleep 5
while ! nc -z 127.0.0.1 4000; do
echo "Waiting for server at 127.0.0.1:4000..."
sleep 1
done
./build.sh --database --restart
cd backend/tests
npx jest
fi