forked from syncthing/syncthing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-linux.bash
executable file
·69 lines (54 loc) · 1.52 KB
/
build-linux.bash
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
set -euo pipefail
# Copyright (C) 2016 The Syncthing Authors.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
# This script should be run by Jenkins as './src/github.com/syncthing/syncthing/jenkins/build-linux.bash',
# that is, it should be run from $GOPATH.
. src/github.com/syncthing/syncthing/jenkins/common.bash
init
# after init we are in the source directory
clean
fetchExtra
buildSource
build
test
testWithCoverage
platforms=(
dragonfly-amd64
freebsd-amd64 freebsd-386
linux-amd64 linux-386 linux-arm linux-arm64 linux-ppc64 linux-ppc64le
netbsd-amd64 netbsd-386
openbsd-amd64 openbsd-386
solaris-amd64
)
echo Building
for plat in "${platforms[@]}"; do
echo Building "$plat"
goos="${plat%-*}"
goarch="${plat#*-}"
go run build.go -goos "$goos" -goarch "$goarch" tar
mv *.tar.gz "$WORKSPACE"
echo
done
go run build.go -goarch amd64 deb
go run build.go -goarch i386 deb
go run build.go -goarch armel deb
go run build.go -goarch armhf deb
mv *.deb "$WORKSPACE"
go run build.go -goarch amd64 snap
go run build.go -goarch armhf snap
go run build.go -goarch arm64 snap
mv *.snap "$WORKSPACE"
if [[ -d /usr/local/oldgo ]]; then
echo
echo Building with minimum supported Go version
export GOROOT=/usr/local/oldgo
export PATH="$GOROOT/bin:$PATH"
go version
echo
rm -rf "$GOPATH/pkg"
go run build.go install all # only compile, don't run lints and stuff
fi