2016-08-14 20:48:11 +00:00
|
|
|
#!/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,
|
2017-02-09 06:52:18 +00:00
|
|
|
# You can obtain one at https://mozilla.org/MPL/2.0/.
|
2016-08-14 20:48:11 +00:00
|
|
|
|
|
|
|
# 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
|
2017-03-05 09:13:07 +00:00
|
|
|
linux-amd64 linux-386 linux-arm linux-arm64 linux-ppc64 linux-ppc64le linux-mips linux-mipsle
|
2016-08-14 20:48:11 +00:00
|
|
|
netbsd-amd64 netbsd-386
|
|
|
|
openbsd-amd64 openbsd-386
|
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2017-02-08 13:02:09 +00:00
|
|
|
export BUILD_USER=deb
|
2016-08-14 20:48:11 +00:00
|
|
|
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
|
2017-02-04 14:18:54 +00:00
|
|
|
go run build.go -goarch arm64 deb
|
2016-09-12 12:21:07 +00:00
|
|
|
|
2016-08-14 20:48:11 +00:00
|
|
|
mv *.deb "$WORKSPACE"
|
2016-10-20 09:31:07 +00:00
|
|
|
|
2017-02-08 13:02:09 +00:00
|
|
|
export BUILD_USER=snap
|
2016-10-20 09:31:07 +00:00
|
|
|
go run build.go -goarch amd64 snap
|
2016-11-09 00:52:33 +00:00
|
|
|
go run build.go -goarch armhf snap
|
|
|
|
go run build.go -goarch arm64 snap
|
2016-10-20 09:31:07 +00:00
|
|
|
|
|
|
|
mv *.snap "$WORKSPACE"
|
2016-12-18 18:25:27 +00:00
|
|
|
|
|
|
|
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
|