-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sh
executable file
·59 lines (51 loc) · 1.07 KB
/
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
#!/bin/bash
#
# Usage ./build.sh [-jX]
# Example: ./build.sh -j10 (make will run with 10 threads)
#
# Get a numthreads argument (for parallel compilation)
# example: 4
if [ -z $1 ]
then
makedashjarg="-j2"
else
makedashjarg=$1
fi
# Colors
ORANGE='\033[0;33m'
CYAN='\033[0;36m'
NC='\033[0m' # No Color
TOPDIR=`pwd`
printf "${ORANGE}"
echo "======================================"
echo " eduWRENCH - Build"
echo "======================================"
printf "\n${NC}"
# build simulators
printf "${CYAN}"
echo "[1/3] COMPILING SIMULATORS"
printf "${NC}\n"
for dir in `ls simulators/`; do
echo "Building in simulator/$dir ..."
cd simulators/$dir
if [[ -f build.sh ]]; then
./build.sh $makedashjarg
if [[ $? -ne 0 ]]; then
exit 1
fi
fi
cd $TOPDIR
done
printf "${CYAN}\n"
echo "[2/3] BUILDING SERVER"
printf "${NC}\n"
mkdir db
cd server
npm install && npm audit fix && npx knex migrate:latest
cd $TOPDIR
printf "${CYAN}\n"
echo "[3/3] BULDING FRONT-END"
printf "${NC}\n"
cd web
npm install && gatsby build
cd $TOPDIR