adding build file

This commit is contained in:
Shlomi Noach 2016-03-23 12:39:24 +01:00
parent 09046c8f6e
commit 1576119576

18
build.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
buildpath=/tmp/gh-osc
target=gh-osc
timestamp=$(date "+%Y%m%d%H%M%S")
mkdir -p ${buildpath}
gobuild="go build -o $buildpath/$target go/cmd/gh-osc/main.go"
echo "Building OS/X binary"
echo "GO15VENDOREXPERIMENT=1 GOOS=darwin GOARCH=amd64 $gobuild" | bash
(cd $buildpath && tar cfz ./gh-osc-binary-osx-${timestamp}.tar.gz $target)
echo "Building linux binary"
echo "GO15VENDOREXPERIMENT=1 GOOS=linux GOARCH=amd64 $gobuild" | bash
(cd $buildpath && tar cfz ./gh-osc-binary-linux-${timestamp}.tar.gz $target)
echo "Binaries found in:"
ls -1 $buildpath/gh-osc-binary*${timestamp}.tar.gz