mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-10 07:11:08 +00:00
Build script from discosrv
This commit is contained in:
parent
f86946c6df
commit
dab1c4cfc9
2
.gitignore
vendored
2
.gitignore
vendored
@ -22,3 +22,5 @@ _testmain.go
|
||||
*.exe
|
||||
*.test
|
||||
*.prof
|
||||
*.tar.gz
|
||||
*.zip
|
||||
|
37
build.sh
Executable file
37
build.sh
Executable file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
set nullglob
|
||||
|
||||
echo Get dependencies
|
||||
go get -d
|
||||
|
||||
rm -rf relaysrv-*-*
|
||||
|
||||
build() {
|
||||
export GOOS="$1"
|
||||
export GOARCH="$2"
|
||||
target="relaysrv-$GOOS-$GOARCH"
|
||||
go build -v
|
||||
mkdir "$target"
|
||||
if [ -f relaysrv ] ; then
|
||||
mv relaysrv "$target"
|
||||
tar zcvf "$target.tar.gz" "$target"
|
||||
fi
|
||||
if [ -f relaysrv.exe ] ; then
|
||||
mv relaysrv.exe "$target"
|
||||
zip -r "$target.zip" "$target"
|
||||
fi
|
||||
}
|
||||
|
||||
for goos in linux darwin windows freebsd openbsd netbsd solaris ; do
|
||||
build "$goos" amd64
|
||||
done
|
||||
for goos in linux windows freebsd openbsd netbsd ; do
|
||||
build "$goos" 386
|
||||
done
|
||||
build linux arm
|
||||
|
||||
# Hack used because we run as root under Docker
|
||||
if [[ ${CHOWN_USER:-} != "" ]] ; then
|
||||
chown -R $CHOWN_USER .
|
||||
fi
|
Loading…
Reference in New Issue
Block a user