From 7892e2d821075193c7b88f0d97809689b781a005 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Sat, 29 Apr 2017 13:11:36 -0700 Subject: [PATCH] add build.sh for package builds --- build.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 build.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..e603c3e --- /dev/null +++ b/build.sh @@ -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