-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sh
executable file
·36 lines (33 loc) · 930 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
#!/usr/bin/env bash
# don't forget to export GOPATH
echo using GOPATH as $GOPATH
if [ "$1" = "local" ]; then
for GOOS in darwin linux windows; do
for GOARCH in 386 amd64; do
echo "Building $GOOS-$GOARCH"
export GOOS=$GOOS
export GOARCH=$GOARCH
if [ "$GOOS" = "windows" ]; then
go get -u github.com/spf13/cobra
fi
go build -a -o bin/veri-$GOOS-$GOARCH
done
done
unset GOOS
unset GOARCH
else
docker run --rm -it -v "$GOPATH":/go -w /go/src/github.com/bgokden/veri dockercore/golang-cross:1.16.5 sh -c '
for GOOS in darwin linux windows; do
for GOARCH in 386 amd64; do
echo "Building $GOOS-$GOARCH"
export GOOS=$GOOS
export GOARCH=$GOARCH
if [ "$GOOS" = "windows" ]; then
go get -u github.com/spf13/cobra
fi
go build -a -o bin/veri-$GOOS-$GOARCH
done
done
'
fi
echo "Binaries can be found under bin directory"