forked from tmnhs/Crony
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
48 lines (36 loc) · 794 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
#!/bin/sh
CURDIR=$(dirname "$0")
cd $CURDIR
PROJECTADMIN="cronyadmin"
PROJECTNODE="cronynode"
PROJECTBASE="."
ProjectBin=$PROJECTBASE/bin
AdminConf="$ProjectBin/admin"
NodeConf="$ProjectBin/node"
WebFile="admin/web"
echo "start build file to $ProjectBin"
check() {
EXCODE=$?
if [ "$EXCODE" != "0" ]; then
echo "build fail."
exit $EXCODE
fi
}
rm -rf $ProjectBin
mkdir -p $AdminConf/logs/
cp -r admin/conf $AdminConf
mkdir -p $NodeConf/logs
cp -r node/conf $NodeConf
#admin
echo "building project cronyadmin..."
go build -o $ProjectBin/$PROJECTADMIN ./admin/cmd/main.go
check
#node
echo "building project cronynode..."
go build -o $ProjectBin/$PROJECTNODE ./node/cmd/main.go
check
#web
echo "building web..."
cd $WebFile &&yarn build
mv ./dist ../../bin/
echo "build success."