Skip to content

Commit

Permalink
Merge pull request #324 from bowei/fix-build
Browse files Browse the repository at this point in the history
Fix build to only build the executable target
  • Loading branch information
MrHohn committed Jun 8, 2018
2 parents 736e0e3 + fc80b58 commit 97d4099
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 29 deletions.
13 changes: 5 additions & 8 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,11 @@ if [ $GOARCH == "amd64" ]; then
export GOBIN="$GOPATH/bin/linux_amd64"
fi

BIN_PKG="$PKG/cmd/$(basename ${TARGET})"
LD_FLAGS="-X ${PKG}/pkg/version.Version=${VERSION} -X ${PKG}/pkg/version.GitCommit=${GIT_COMMIT}"

if echo "${TARGET}" | grep '.*-test$'; then
go test -c \
-ldflags "-X ${PKG}/pkg/version.Version=${VERSION} -X ${PKG}/pkg/version.GitCommit=${GIT_COMMIT}" \
-o "${TARGET}" \
"$PKG/cmd/$(basename ${TARGET})"
go test -c -ldflags "${LD_FLAGS}" -o "${TARGET}" "${BIN_PKG}"
else
go install \
-installsuffix "static" \
-ldflags "-X ${PKG}/pkg/version.Version=${VERSION} -X ${PKG}/pkg/version.GitCommit=${GIT_COMMIT}" \
./...
go install -i -installsuffix "static" -ldflags "${LD_FLAGS}" "${BIN_PKG}"
fi
3 changes: 2 additions & 1 deletion build/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ $(GO_BINARIES): build-dirs
TARGET=$@ \
GIT_COMMIT=$(GIT_COMMIT) \
./build/build.sh \
"
" \
$(VERBOSE_OUTPUT)

# Rules for dockerfiles.
define DOCKERFILE_RULE
Expand Down
20 changes: 0 additions & 20 deletions cmd/e2e-test/placeholder.go

This file was deleted.

0 comments on commit 97d4099

Please sign in to comment.