No Description
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.sh 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/usr/bin/env bash
  2. source ./config.sh
  3. # revision number
  4. sed "s/\$version/"$version"/g" help/version.tpl > help/version.go
  5. dir=license-server
  6. name=license-server
  7. dirs="$dir/$name"
  8. rm -rf "$dir"/*
  9. # mac
  10. CGO_ENABLED=0 GOOS=darwin GOARCH=386 go build -o "$dirs"_darwin_386
  11. CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o "$dirs"_darwin_amd64
  12. # freebsd
  13. CGO_ENABLED=0 GOOS=freebsd GOARCH=386 go build -o "$dirs"_freebsd_386
  14. CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -o "$dirs"_freebsd_amd64
  15. CGO_ENABLED=0 GOOS=freebsd GOARCH=arm go build -o "$dirs"_freebsd_arm
  16. # linux
  17. CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -o "$dirs"_linux_386
  18. CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o "$dirs"_linux_amd64
  19. CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 go build -o "$dirs"_linux_arm5
  20. CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -o "$dirs"_linux_arm6
  21. CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -o "$dirs"_linux_arm7
  22. CGO_ENABLED=0 GOOS=linux GOARCH=mips go build -o "$dirs"_linux_mips
  23. CGO_ENABLED=0 GOOS=linux GOARCH=mipsle go build -o "$dirs"_linux_mipsle
  24. CGO_ENABLED=0 GOOS=linux GOARCH=mips64 go build -o "$dirs"_linux_mips64
  25. CGO_ENABLED=0 GOOS=linux GOARCH=mips64le go build -o "$dirs"_linux_mips64le
  26. # netbsd
  27. CGO_ENABLED=0 GOOS=netbsd GOARCH=386 go build -o "$dirs"_netbsd_386
  28. CGO_ENABLED=0 GOOS=netbsd GOARCH=amd64 go build -o "$dirs"_netbsd_amd64
  29. CGO_ENABLED=0 GOOS=netbsd GOARCH=arm go build -o "$dirs"_netbsd_arm
  30. # openbsd
  31. CGO_ENABLED=0 GOOS=openbsd GOARCH=386 go build -o "$dirs"_openbsd_386
  32. CGO_ENABLED=0 GOOS=openbsd GOARCH=amd64 go build -o "$dirs"_openbsd_amd64
  33. # windows
  34. CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -o "$dirs"_windows_386.exe
  35. CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o "$dirs"_windows_amd64.exe
  36. # upx compress better ,require(brew install upx)
  37. upx -f9 license-server/*
  38. # md5
  39. md5sum "$dir"/* >> "$dir"/md5sum
  40. # copy files
  41. rm -rf ../license-server-file/license-server
  42. mkdir ../license-server-file
  43. mkdir ../license-server-file/license-server
  44. cp -rf "$dir" ../license-server-file
  45. # compress tar
  46. cd ../license-server-file
  47. tar -zcvf "license-server($version)".tar.gz license-server/*
  48. md5sum "license-server($version)".tar.gz >> md5sum
  49. # rm license-server-file/license-server
  50. rm -rf license-server