forked from likexian/stathub-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·46 lines (37 loc) · 834 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
#!/bin/bash
echo '+ building stathub start'
[ ! -d stathub ] && mkdir stathub
rm -rf tmp && mkdir tmp
echo 'building the server'
cd server
go build
cd ..
mv server/server tmp
cp server/service tmp
echo 'building the client'
cd client
go build
cd ..
mv client/client tmp
cp CHANGS.md tmp
cp CHANGS-ZH.md tmp
cp LICENSE.md tmp
cp README.md tmp
cp README-ZH.md tmp
cp VERSION tmp
command_exists() {
type "$1" &> /dev/null
}
echo 'goupxing binary files'
cd tmp
if command_exists goupx; then
goupx server client >/dev/null 2>&1
fi
echo 'packaging the server'
tar zcf server_$(uname -m).tar.gz server service VERSION *.md
echo 'packaging the client'
tar zcf client_$(uname -m).tar.gz client VERSION *.md
cd ..
cp tmp/server_$(uname -m).tar.gz tmp/client_$(uname -m).tar.gz stathub
rm -rf tmp
echo '+ building stathub done'