From 57d5dfa80c2eaf60e344f5702aa3c78c9544ca90 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sat, 11 Nov 2017 23:49:05 +0100 Subject: [PATCH] jenkins: No jenkins --- jenkins/build-linux.bash | 71 ------------------------ jenkins/build-macos.bash | 40 -------------- jenkins/build-solaris.bash | 38 ------------- jenkins/build-windows.bat | 55 ------------------- jenkins/common.bash | 110 ------------------------------------- 5 files changed, 314 deletions(-) delete mode 100755 jenkins/build-linux.bash delete mode 100755 jenkins/build-macos.bash delete mode 100755 jenkins/build-solaris.bash delete mode 100644 jenkins/build-windows.bat delete mode 100644 jenkins/common.bash diff --git a/jenkins/build-linux.bash b/jenkins/build-linux.bash deleted file mode 100755 index c9086fe9..00000000 --- a/jenkins/build-linux.bash +++ /dev/null @@ -1,71 +0,0 @@ -#!/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 https://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 linux-mips linux-mipsle - 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 - -export BUILD_USER=deb -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 -go run build.go -goarch arm64 deb - -mv *.deb "$WORKSPACE" - -export BUILD_USER=snap -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 diff --git a/jenkins/build-macos.bash b/jenkins/build-macos.bash deleted file mode 100755 index 9528ca19..00000000 --- a/jenkins/build-macos.bash +++ /dev/null @@ -1,40 +0,0 @@ -#!/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 https://mozilla.org/MPL/2.0/. - -# This script should be run by Jenkins as './src/github.com/syncthing/syncthing/jenkins/build-macos.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 -build -test - -platforms=( - darwin-amd64 darwin-386 -) - -# Mac builds always require cgo -export CGO_ENABLED=1 - -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 diff --git a/jenkins/build-solaris.bash b/jenkins/build-solaris.bash deleted file mode 100755 index a32be403..00000000 --- a/jenkins/build-solaris.bash +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -set -euo pipefail - -# Copyright (C) 2017 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 https://mozilla.org/MPL/2.0/. - -# This script should be run by Jenkins as './src/github.com/syncthing/syncthing/jenkins/build-macos.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 - -# Solaris always uses cgo, as opposed to our regular cross builds -export CGO_ENABLED=1 - -# Quick build, generate assets -go run build.go build syncthing - -# Test the stuff we are going to build only, as discosrv etc fails. -# -race is not supported on Solaris. -echo Testing -go test ./lib/... ./cmd/syncthing -echo - -# Specifically set "syncthing" target as discosrv currently doesn't build -echo Building -go run build.go tar syncthing -mv *.tar.gz "$WORKSPACE" -echo diff --git a/jenkins/build-windows.bat b/jenkins/build-windows.bat deleted file mode 100644 index c78d7c8d..00000000 --- a/jenkins/build-windows.bat +++ /dev/null @@ -1,55 +0,0 @@ -@echo off - -rem Copyright (C) 2016 The Syncthing Authors. -rem -rem This Source Code Form is subject to the terms of the Mozilla Public -rem License, v. 2.0. If a copy of the MPL was not distributed with this file, -rem You can obtain one at https://mozilla.org/MPL/2.0/. - -rem This batch file should be run from the GOPATH. -rem It expects to run on amd64, for windows-amd64 Go to be installed in C:\go -rem and for windows-386 Go to be installed in C:\go-386. - -rem cURL should be installed in C:\Program Files\cURL. - -set ORIGPATH="C:\Program Files\cURL\bin";%PATH% -set PATH=c:\go\bin;%ORIGPATH% -set GOROOT=c:\go - -cd >gopath -set /p GOPATH= coverage.out - fail=0 - - # For every package in the repo - for dir in $(go list ./lib/... ./cmd/...) ; do - # run the tests - GOPATH="$(pwd)/Godeps/_workspace:$GOPATH" go test -coverprofile=profile.out $dir - if [ -f profile.out ] ; then - # and if there was test output, append it to coverage.out - grep -v "mode: " profile.out >> coverage.out - rm profile.out - fi - done - - gocov convert coverage.out | gocov-xml > coverage.xml - - # This is usually run from within Jenkins. If it is, we need to - # tweak the paths in coverage.xml so cobertura finds the - # source. - if [[ "${WORKSPACE:-default}" != "default" ]] ; then - sed "s#$WORKSPACE##g" < coverage.xml > coverage.xml.new && mv coverage.xml.new coverage.xml - fi - - notCovered=$(egrep -c '\s0$' coverage.out) - total=$(wc -l coverage.out | awk '{print $1}') - coverPct=$(awk "BEGIN{print (1 - $notCovered / $total) * 100}") - echo "$coverPct" > "coverage.txt" - echo "Test coverage is $coverPct%%" - echo - - CGO_ENABLED=0 # reset to before -} - -function buildSource { - echo Archiving source - echo "$version" > RELEASE - pushd .. >/dev/null - tar c -z -f "$WORKSPACE/syncthing-source-$version.tar.gz" --exclude .git syncthing - popd >/dev/null - echo -}