forked from funkygao/fae
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·54 lines (46 loc) · 1.47 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
#!/bin/bash -e
if [[ $1 = "-loc" ]]; then
cd $(dirname $0)/servant; make clean; cd -
find . -name '*.go' | xargs wc -l | sort -n
exit
fi
VER=0.3.2stable
ID=$(git rev-parse HEAD | cut -c1-7)
if [[ $1 = "-dw" ]]; then
cp -f servant/gen-php/fun/rpc/* /Users/gaopeng/fun/dragon-server-code/v2/fae
exit
fi
FAE_HOME=/sgn/app/fae
if [[ $1 = "-install" ]]; then
mkdir -p $FAE_HOME/bin $FAE_HOME/var $FAE_HOME/etc
cp -f bin/faed.linux $FAE_HOME/bin/faed
cp -f etc/faed.cf.sample $FAE_HOME/etc/faed.cf
cp -f etc/faed /etc/init.d/faed
echo 'update config: metrics_logfile'
echo 'Done'
exit
fi
if [[ $1 = "-cpu" ]]; then
go tool pprof ./daemon/faed/faed prof/cpu.pprof
exit
fi
if [[ $1 = "-mem" ]]; then
go tool pprof ./daemon/faed/faed prof/mem.pprof
exit
fi
cd $(dirname $0)/servant; make
cd ../daemon/faed
if [[ $1 = "-linux" ]]; then
#cp -f ../../servant/gen-php/fun/rpc/* /Users/gaopeng/fun/dragon-server-code/v2/fae
#cd $GOROOT/src
#sudo CGO_ENABLED=0 GOOS=linux GOARCH=amd64 ./make.bash
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/nicholaskh/golib/server.VERSION $VER -X github.com/nicholaskh/golib/server.BuildID $ID"
exit
else
#go build -race -v -ldflags "-X github.com/nicholaskh/fae/engine.BuildID $ID"
go build -ldflags "-X github.com/nicholaskh/golib/server.VERSION $VER -X github.com/nicholaskh/golib/server.BuildID $ID -w"
fi
#---------
# show ver
#---------
./faed -version