Revision 75f8282eef351ed09ab29f362a92001bd9b10bf3 authored by Yicheng Qin on 16 October 2015, 04:31:51 UTC, committed by Yicheng Qin on 16 October 2015, 04:31:51 UTC
1 parent 45c86af
build
#!/bin/sh -e
ORG_PATH="github.com/coreos"
REPO_PATH="${ORG_PATH}/etcd"
export GOPATH=${PWD}/gopath
rm -f $GOPATH/src/${REPO_PATH}
mkdir -p $GOPATH/src/${ORG_PATH}
ln -s ${PWD} $GOPATH/src/${REPO_PATH}
eval $(go env)
GIT_SHA=`git rev-parse --short HEAD || echo "GitNotFound"`
val=$(go version)
ver=$(echo $val | awk -F ' ' '{print $3}' | awk -F '.' '{print $2}')
if [ $ver -gt 4 ]; then
LINK_OPERATOR="="
else
LINK_OPERATOR=" "
fi
# Static compilation is useful when etcd is run in a container
CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags "-s -X ${REPO_PATH}/version.GitSHA${LINK_OPERATOR}${GIT_SHA}" -o bin/etcd ${REPO_PATH}
CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags "-s" -o bin/etcdctl ${REPO_PATH}/etcdctl
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...