Skip to content

Commit

Permalink
Use 'go install' to build all commands at the same time.
Browse files Browse the repository at this point in the history
'go build' compiles the packages but discards the results if multiple packages specified.
  • Loading branch information
zhgwenming committed Jul 28, 2014
1 parent f91bfe2 commit 0375709
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@

# Version file we automatically make
/pkg/version/autogenerated.go

# compiled binaries in third_party
/third_party/pkg
2 changes: 1 addition & 1 deletion cluster/kubecfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
source $(dirname $0)/kube-env.sh
source $(dirname $0)/$KUBERNETES_PROVIDER/util.sh

CLOUDCFG=$(dirname $0)/../output/go/kubecfg
CLOUDCFG=$(dirname $0)/../output/go/bin/kubecfg
if [ ! -x $CLOUDCFG ]; then
echo "Could not find kubecfg binary. Run hack/build-go.sh to build it."
exit 1
Expand Down
5 changes: 1 addition & 4 deletions hack/build-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,4 @@ if [ $# -gt 0 ]; then
BINARIES="$@"
fi

for b in ${BINARIES}; do
echo "+++ Building ${b}"
go build "${KUBE_GO_PACKAGE}/${b}"
done
go install $(for b in $BINARIES; do echo "${KUBE_GO_PACKAGE}"/${b}; done)
3 changes: 3 additions & 0 deletions hack/config-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,7 @@ KUBE_GO_PACKAGE_DIR="${GOPATH}/src/${KUBE_GO_PACKAGE}"
rm "${KUBE_GO_PACKAGE_DIR}" >/dev/null 2>&1 || true
ln -s "${KUBE_REPO_ROOT}" "${KUBE_GO_PACKAGE_DIR}"
)

# unset GOBIN in case it already exsit in the current session
unset GOBIN
export GOPATH="${KUBE_TARGET}:${KUBE_REPO_ROOT}/third_party"
2 changes: 1 addition & 1 deletion hack/integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ ETCD_PID=$!

sleep 5

$(dirname $0)/../output/go/integration
$(dirname $0)/../output/go/bin/integration

kill $ETCD_PID
2 changes: 1 addition & 1 deletion hack/local-up-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ set +e
API_PORT=8080
KUBELET_PORT=10250

GO_OUT=$(dirname $0)/../output/go
GO_OUT=$(dirname $0)/../output/go/bin

APISERVER_LOG=/tmp/apiserver.log
${GO_OUT}/apiserver \
Expand Down

0 comments on commit 0375709

Please sign in to comment.