Skip to content

Commit

Permalink
bin/build: speed-up local build time
Browse files Browse the repository at this point in the history
In case we have GOPATH defined, we probably have the dependencies, than
we don't need to download them again. It still works as expected in a
box with no GOPATH defined.

It's way faster to avoid downloading the dependencies. This is because
`go get` is dumb when cloning Git repositories. This should probably
change when golang/go#13078 is fixed (Go 1.7, hopefully).
  • Loading branch information
Francisco Souza committed Feb 24, 2016
1 parent 9f16f05 commit 9d18198
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ export CODE=$GOTMP/src/github.com/nytm/video-transcoding-api
mkdir -p $CODE
cp -R . $CODE

if [ -z "$GOPATH" ]; then
export GOPATH=$GOTMP
fi

# Download dependencies and build
pushd $CODE
GOPATH=$GOTMP go get -d
GOPATH=$GOTMP GOARCH=amd64 GOOS=linux go build -o $OUTPUT/video-transcoding-api
go get -d
GOARCH=amd64 GOOS=linux go build -o $OUTPUT/video-transcoding-api
cp config.json $OUTPUT/.
cp swagger.json $OUTPUT/.
popd
Expand Down

0 comments on commit 9d18198

Please sign in to comment.