Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build to only build the executable target #324

Merged
merged 1 commit into from
Jun 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.