add build.sh for package builds

This commit is contained in:
Cadey Ratio 2017-04-29 13:11:36 -07:00
parent 4f37100b71
commit 7892e2d821
1 changed files with 21 additions and 0 deletions

21
build.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
dir="$(mktemp -d)"
plugdir="$dir/plugins"
githash="$(git rev-parse HEAD)"
wd="$(pwd)"
libc="glibc"
[[ -f "/lib/libc.musl-x86_64.so.1" ]] && libc="musl"
export GOBIN="$dir/bin"
go build git.xeserv.us/xena/route/cmd/...
go install git.xeserv.us/xena/route/cmd/...
go build -buildmode plugin -o $plugdir/autohttpagent.so git.xeserv.us/xena/route/plugins/autohttpagent
cd $dir
tar czf "$wd/route-$libc-$githash.tgz" *
cd $wd
rm -rf $dir