gh-ost/build.sh

23 lines
697 B
Bash
Raw Normal View History

2016-03-23 11:39:24 +00:00
#!/bin/bash
#
#
RELEASE_VERSION="0.7.16"
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-17 09:51:21 +00:00
ldflags="-X main.AppVersion=${RELEASE_VERSION}"
gobuild="go build -ldflags \"$ldflags\" -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