A cross-platform service manager
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build-all.sh 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #GOOS=windows GOARCH=amd64 go install
  2. #go tool dist list
  3. # TODO move this into tools/build.go
  4. export CGO_ENABLED=0
  5. exe=serviceman
  6. gocmd=.
  7. echo ""
  8. go generate -mod=vendor ./...
  9. echo ""
  10. echo "Windows amd64"
  11. GOOS=windows GOARCH=amd64 go build -mod=vendor -o dist/windows/amd64/${exe}.exe -ldflags "-H=windowsgui" $gocmd
  12. GOOS=windows GOARCH=amd64 go build -mod=vendor -o dist/windows/amd64/${exe}.debug.exe
  13. echo "Windows 386"
  14. GOOS=windows GOARCH=386 go build -mod=vendor -o dist/windows/386/${exe}.exe -ldflags "-H=windowsgui" $gocmd
  15. GOOS=windows GOARCH=386 go build -mod=vendor -o dist/windows/386/${exe}.debug.exe
  16. echo ""
  17. echo "Darwin (macOS) amd64"
  18. GOOS=darwin GOARCH=amd64 go build -mod=vendor -o dist/darwin/amd64/${exe} $gocmd
  19. echo ""
  20. echo "Linux amd64"
  21. GOOS=linux GOARCH=amd64 go build -mod=vendor -o dist/linux/amd64/${exe} $gocmd
  22. echo "Linux 386"
  23. GOOS=linux GOARCH=386 go build -mod=vendor -o dist/linux/386/${exe} $gocmd
  24. echo ""
  25. echo "RPi 4 (64-bit) ARMv8"
  26. GOOS=linux GOARCH=arm64 go build -mod=vendor -o dist/linux/armv8/${exe} $gocmd
  27. echo "RPi 3 B+ ARMv7"
  28. GOOS=linux GOARCH=arm GOARM=7 go build -mod=vendor -o dist/linux/armv7/${exe} $gocmd
  29. echo "ARMv6"
  30. GOOS=linux GOARCH=arm GOARM=6 go build -mod=vendor -o dist/linux/armv6/${exe} $gocmd
  31. echo "RPi Zero ARMv5"
  32. GOOS=linux GOARCH=arm GOARM=5 go build -mod=vendor -o dist/linux/armv5/${exe} $gocmd
  33. echo ""
  34. #rsync -av ./dist/ ubuntu@rootprojects.org:/srv/www/rootprojects.org/serviceman/dist/
  35. # https://rootprojects.org/serviceman/dist/windows/amd64/serviceman.exe