forked from polynetwork/poly-bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·40 lines (29 loc) · 859 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
#!/bin/bash
tag=$1
base=build_${tag}
if [ ! -d "./$base" ]; then
mkdir -p "./$base"
fi
go build -tags $tag -o bridge_server ./cmd
go build -tags $tag -o bridge_http ./
go build -tags $tag -o tools ./bridge_tools
if [ ! -d "./$base/bridge_server" ]; then
mkdir -p "./$base/bridge_server"
fi
if [ ! -d "./$base/bridge_http" ]; then
mkdir -p "./$base/bridge_http"
fi
if [ ! -d "./$base/bridge_tools" ]; then
mkdir -p "./$base/bridge_tools"
fi
mv bridge_server ./$base/bridge_server/bridge_server
mv bridge_http ./$base/bridge_http/bridge_http
mv tools ./$base/bridge_tools/bridge_tools
if [ "$tag"x = "mainnet"x ]
then
cp ./conf/config_mainnet.json ./$base/bridge_server/
cp ./conf/config_mainnet.json ./$base/bridge_http/
else
cp ./conf/config_testnet.json ./$base/bridge_server/
cp ./conf/config_testnet.json ./$base/bridge_http/
fi