gh-ost/build.sh

21 lines
602 B
Bash
Raw Normal View History

2016-03-23 11:39:24 +00:00
#!/bin/bash
#
#
2016-03-23 11:39:24 +00:00
2016-05-16 09:09:17 +00:00
buildpath=/tmp/gh-ost
target=gh-ost
2016-03-23 11:39:24 +00:00
timestamp=$(date "+%Y%m%d%H%M%S")
mkdir -p ${buildpath}
2016-05-16 09:09:17 +00:00
gobuild="go build -o $buildpath/$target go/cmd/gh-ost/main.go"
2016-03-23 11:39:24 +00:00
echo "Building OS/X binary"
echo "GO15VENDOREXPERIMENT=1 GOOS=darwin GOARCH=amd64 $gobuild" | bash
2016-05-16 09:09:17 +00:00
(cd $buildpath && tar cfz ./gh-ost-binary-osx-${timestamp}.tar.gz $target)
2016-03-23 11:39:24 +00:00
echo "Building linux binary"
echo "GO15VENDOREXPERIMENT=1 GOOS=linux GOARCH=amd64 $gobuild" | bash
2016-05-16 09:09:17 +00:00
(cd $buildpath && tar cfz ./gh-ost-binary-linux-${timestamp}.tar.gz $target)
2016-03-23 11:39:24 +00:00
echo "Binaries found in:"
2016-05-16 09:09:17 +00:00
ls -1 $buildpath/gh-ost-binary*${timestamp}.tar.gz