-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
53 lines (42 loc) · 985 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
48
49
50
51
52
53
WORKROOT=$(pwd)
export GOPATH=${WORKROOT}
# try to download bce-sdk-go from github
go env -w GO111MODULE=on
if [ $? -ne 0 ]
then
echo "fail to set env GO111MODULE"
exit 1
fi
go env -w GONOPROXY=\*\*.baidu.com\*\*
go env -w GOPROXY=https://goproxy.baidu.com
go env -w GONOSUMDB=\*
chmod +w pkg -R 2>&1 > /dev/null
rm -rf pkg/mod/github.com/baidubce/bce-sdk-go*
rm -rf ./src/github.com/baidubce/bce-sdk-go
go get -d github.com/baidubce/bce-sdk-go@1a69080
if [ $? -ne 0 ]
then
echo "fail to get bce-sdk-go"
exit 1
fi
chmod +w ./pkg -R
mkdir -p ./src/github.com/baidubce/
mv pkg/mod/github.com/baidubce/bce-sdk-go* ./src/github.com/baidubce/bce-sdk-go
go env -w GO111MODULE=off
# start to build bcecmd
cd $WORKROOT/src/main
go build bcecmd.go
if [ $? -ne 0 ];
then
echo "fail to build bcecmd.go"
exit 1
fi
cd ../../
if [ -d "./output" ]
then
rm -rf output
fi
mkdir output
mv src/main/bcecmd "output/bcecmd"
chmod +x output/bcecmd
echo "OK for build bcecmd"