Skip to content

Commit

Permalink
simplify godep usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mreiferson committed Dec 7, 2013
1 parent ab2a0bc commit ab80201
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ all: $(BINARIES) $(EXAMPLES)

$(BLDDIR)/%:
mkdir -p $(dir $@)
godep go build ${GOFLAGS} -o $(abspath $@) ./$*
go build ${GOFLAGS} -o $(abspath $@) ./$*

$(BINARIES): %: $(BLDDIR)/%
$(EXAMPLES): %: $(BLDDIR)/apps/%
Expand Down
2 changes: 2 additions & 0 deletions dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# build binary distributions for linux/amd64 and darwin/amd64

export GOPATH=$(godep path):$GOPATH

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
mkdir -p $DIR/dist

Expand Down
13 changes: 6 additions & 7 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
#!/bin/bash
set -e

runner="godep"
if go version | grep -q "go1.0"; then
if go version | grep -q -v "go1.0"; then
# godep doesn't build for go1 so dont use it
runner=""
export GOPATH=$(godep path):$GOPATH
fi

# build and run nsqlookupd
echo "building and starting nsqlookupd"
$runner go build -o nsqlookupd/nsqlookupd ./nsqlookupd
go build -o nsqlookupd/nsqlookupd ./nsqlookupd
nsqlookupd/nsqlookupd >/dev/null 2>&1 &
LOOKUPD_PID=$!

# build and run nsqd configured to use our lookupd above
cmd="nsqd/nsqd --data-path=/tmp --lookupd-tcp-address=127.0.0.1:4160 --tls-cert=nsqd/test/cert.pem --tls-key=nsqd/test/key.pem"
echo "building and starting $cmd"
$runner go build -o nsqd/nsqd ./nsqd
go build -o nsqd/nsqd ./nsqd
$cmd >/dev/null 2>&1 &
NSQD_PID=$!

Expand All @@ -28,10 +27,10 @@ cleanup() {
}
trap cleanup INT TERM EXIT

$runner go test -v -timeout 60s ./...
go test -v -timeout 60s ./...

# no tests, but a build is something
for dir in nsqadmin apps/* bench/*; do
echo "building $dir"
$runner go build -o $dir/$(basename $dir) ./$dir
go build -o $dir/$(basename $dir) ./$dir
done

0 comments on commit ab80201

Please sign in to comment.