go-watchdog/build-all.sh

49 lines
1.8 KiB
Bash
Raw Permalink Normal View History

#GOOS=windows GOARCH=amd64 go install
#go tool dist list
# TODO move this into tools/build.go
export CGO_ENABLED=0
exe=watchdog
2019-07-05 00:32:36 +00:00
distpre=../..
gocmd=.
echo ""
go generate -mod=vendor ./...
2019-07-05 00:32:36 +00:00
pushd cmd/${exe}
echo ""
echo "Windows amd64"
2019-07-05 00:32:36 +00:00
#GOOS=windows GOARCH=amd64 go build -mod=vendor -o ${distpre}/dist/windows/amd64/${exe}.exe -ldflags "-H=windowsgui" $gocmd
#GOOS=windows GOARCH=amd64 go build -mod=vendor -o ${distpre}/dist/windows/amd64/${exe}.debug.exe
GOOS=windows GOARCH=amd64 go build -mod=vendor -o ${distpre}/dist/windows/amd64/${exe}.exe
echo "Windows 386"
2019-07-05 00:32:36 +00:00
#GOOS=windows GOARCH=386 go build -mod=vendor -o ${distpre}/dist/windows/386/${exe}.exe -ldflags "-H=windowsgui" $gocmd
#GOOS=windows GOARCH=386 go build -mod=vendor -o ${distpre}/dist/windows/386/${exe}.debug.exe
GOOS=windows GOARCH=386 go build -mod=vendor -o ${distpre}/dist/windows/386/${exe}.exe
echo ""
echo "Darwin (macOS) amd64"
2019-07-05 00:32:36 +00:00
GOOS=darwin GOARCH=amd64 go build -mod=vendor -o ${distpre}/dist/darwin/amd64/${exe} $gocmd
echo ""
echo "Linux amd64"
2019-07-05 00:32:36 +00:00
GOOS=linux GOARCH=amd64 go build -mod=vendor -o ${distpre}/dist/linux/amd64/${exe} $gocmd
echo "Linux 386"
2019-07-05 00:32:36 +00:00
GOOS=linux GOARCH=386 go build -mod=vendor -o ${distpre}/dist/linux/386/${exe} $gocmd
echo ""
echo "RPi 4 (64-bit) ARMv8"
2019-07-05 00:32:36 +00:00
GOOS=linux GOARCH=arm64 go build -mod=vendor -o ${distpre}/dist/linux/armv8/${exe} $gocmd
echo "RPi 3 B+ ARMv7"
2019-07-05 00:32:36 +00:00
GOOS=linux GOARCH=arm GOARM=7 go build -mod=vendor -o ${distpre}/dist/linux/armv7/${exe} $gocmd
echo "ARMv6"
2019-07-05 00:32:36 +00:00
GOOS=linux GOARCH=arm GOARM=6 go build -mod=vendor -o ${distpre}/dist/linux/armv6/${exe} $gocmd
echo "RPi Zero ARMv5"
2019-07-05 00:32:36 +00:00
GOOS=linux GOARCH=arm GOARM=5 go build -mod=vendor -o ${distpre}/dist/linux/armv5/${exe} $gocmd
echo ""
2019-07-05 00:32:36 +00:00
popd
rsync -av ./dist/ ubuntu@rootprojects.org:/srv/www/rootprojects.org/$exe/dist/
# https://rootprojects.org/serviceman/dist/windows/amd64/serviceman.exe