Skip to content

Commit

Permalink
Merge pull request #666 from ploxiln/distsh_cleanups
Browse files Browse the repository at this point in the history
dist.sh cleanups
  • Loading branch information
mreiferson committed Oct 1, 2015
2 parents 41ccf8a + 054b225 commit 223c53c
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,13 @@ set -e
# build binary distributions for linux/amd64 and darwin/amd64

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ -e $DIR/dist/docker ]; then
rm -rf $DIR/dist/docker
fi
rm -rf $DIR/dist/docker
mkdir -p $DIR/dist/docker

if [ -e $DIR/.godeps ]; then
rm -rf $DIR/.godeps
fi
rm -rf $DIR/.godeps
mkdir -p $DIR/.godeps
export GOPATH=$DIR/.godeps:$GOPATH
GOPATH=$DIR/.godeps gpm install

os=$(go env GOOS)
arch=$(go env GOARCH)
version=$(awk '/const Binary/ {print $NF}' < $DIR/internal/version/binary.go | sed 's/"//g')
goversion=$(go version | awk '{print $3}')
Expand All @@ -43,13 +37,14 @@ for os in linux darwin; do
BUILD=$(mktemp -d -t nsq)
TARGET="nsq-$version.$os-$arch.$goversion"
GOOS=$os GOARCH=$arch CGO_ENABLED=0 make
make DESTDIR=$BUILD/$TARGET PREFIX= install
make DESTDIR=$BUILD PREFIX=/$TARGET install
pushd $BUILD
if [ "$os" == "linux" ]; then cp -r $BUILD/$TARGET/bin $DIR/dist/docker/; fi
if [ "$os" == "linux" ]; then cp -r $TARGET/bin $DIR/dist/docker/; fi
tar czvf $TARGET.tar.gz $TARGET
mv $TARGET.tar.gz $DIR/dist
popd
make clean
rm -r $BUILD
done

docker build -t nsqio/nsq:v$version .
Expand Down

0 comments on commit 223c53c

Please sign in to comment.