build: remove "./cmd/etcd,etcdctl"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>release-3.4
parent
a270a91292
commit
4d06d32ded
23
build
23
build
|
@ -10,7 +10,7 @@ if [ ! -z "$FAILPOINTS" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set GO_LDFLAGS="-s" for building without symbols for debugging.
|
# Set GO_LDFLAGS="-s" for building without symbols for debugging.
|
||||||
GO_LDFLAGS="$GO_LDFLAGS -X ${REPO_PATH}/cmd/vendor/${REPO_PATH}/version.GitSHA=${GIT_SHA}"
|
GO_LDFLAGS="$GO_LDFLAGS -X ${REPO_PATH}/version.GitSHA=${GIT_SHA}"
|
||||||
|
|
||||||
# enable/disable failpoints
|
# enable/disable failpoints
|
||||||
toggle_failpoints() {
|
toggle_failpoints() {
|
||||||
|
@ -36,31 +36,14 @@ etcd_build() {
|
||||||
# Static compilation is useful when etcd is run in a container. $GO_BUILD_FLAGS is OK
|
# Static compilation is useful when etcd is run in a container. $GO_BUILD_FLAGS is OK
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
CGO_ENABLED=0 go build $GO_BUILD_FLAGS -installsuffix cgo -ldflags "$GO_LDFLAGS" -o "${out}/etcd" ${REPO_PATH}/cmd/etcd || return
|
CGO_ENABLED=0 go build $GO_BUILD_FLAGS -installsuffix cgo -ldflags "$GO_LDFLAGS" -o "${out}/etcd" . || return
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
CGO_ENABLED=0 go build $GO_BUILD_FLAGS -installsuffix cgo -ldflags "$GO_LDFLAGS" -o "${out}/etcdctl" ${REPO_PATH}/cmd/etcdctl || return
|
CGO_ENABLED=0 go build $GO_BUILD_FLAGS -installsuffix cgo -ldflags "$GO_LDFLAGS" -o "${out}/etcdctl" ./etcdctl || return
|
||||||
}
|
|
||||||
|
|
||||||
etcd_setup_gopath() {
|
|
||||||
d=$(dirname "$0")
|
|
||||||
CDIR=$(cd "$d" && pwd)
|
|
||||||
cd "$CDIR"
|
|
||||||
etcdGOPATH="${CDIR}/gopath"
|
|
||||||
# preserve old gopath to support building with unvendored tooling deps (e.g., gofail)
|
|
||||||
if [ -n "$GOPATH" ]; then
|
|
||||||
GOPATH=":$GOPATH"
|
|
||||||
fi
|
|
||||||
export GOPATH=${etcdGOPATH}$GOPATH
|
|
||||||
rm -rf "${etcdGOPATH}/src"
|
|
||||||
mkdir -p "${etcdGOPATH}"
|
|
||||||
ln -s "${CDIR}/cmd/vendor" "${etcdGOPATH}/src"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
toggle_failpoints_default
|
toggle_failpoints_default
|
||||||
|
|
||||||
# only build when called directly, not sourced
|
# only build when called directly, not sourced
|
||||||
if echo "$0" | grep "build$" >/dev/null; then
|
if echo "$0" | grep "build$" >/dev/null; then
|
||||||
# force new gopath so builds outside of gopath work
|
|
||||||
etcd_setup_gopath
|
|
||||||
etcd_build
|
etcd_build
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue