build-linux.bash 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/bash
  2. set -euo pipefail
  3. # Copyright (C) 2016 The Syncthing Authors.
  4. #
  5. # This Source Code Form is subject to the terms of the Mozilla Public
  6. # License, v. 2.0. If a copy of the MPL was not distributed with this file,
  7. # You can obtain one at http://mozilla.org/MPL/2.0/.
  8. # This script should be run by Jenkins as './src/github.com/syncthing/syncthing/jenkins/build-linux.bash',
  9. # that is, it should be run from $GOPATH.
  10. . src/github.com/syncthing/syncthing/jenkins/common.bash
  11. init
  12. # after init we are in the source directory
  13. clean
  14. fetchExtra
  15. buildSource
  16. build
  17. test
  18. testWithCoverage
  19. platforms=(
  20. dragonfly-amd64
  21. freebsd-amd64 freebsd-386
  22. linux-amd64 linux-386 linux-arm linux-arm64 linux-ppc64 linux-ppc64le
  23. netbsd-amd64 netbsd-386
  24. openbsd-amd64 openbsd-386
  25. solaris-amd64
  26. )
  27. echo Building
  28. for plat in "${platforms[@]}"; do
  29. echo Building "$plat"
  30. goos="${plat%-*}"
  31. goarch="${plat#*-}"
  32. go run build.go -goos "$goos" -goarch "$goarch" tar
  33. mv *.tar.gz "$WORKSPACE"
  34. echo
  35. done
  36. go run build.go -goarch amd64 deb
  37. fakeroot sh -c 'chown -R root:root deb ; dpkg-deb -b deb .'
  38. mv *.deb "$WORKSPACE"
  39. go run build.go -goarch i386 deb
  40. fakeroot sh -c 'chown -R root:root deb ; dpkg-deb -b deb .'
  41. mv *.deb "$WORKSPACE"
  42. go run build.go -goarch armel deb
  43. fakeroot sh -c 'chown -R root:root deb ; dpkg-deb -b deb .'
  44. mv *.deb "$WORKSPACE"
  45. go run build.go -goarch armhf deb
  46. fakeroot sh -c 'chown -R root:root deb ; dpkg-deb -b deb .'
  47. mv *.deb "$WORKSPACE"