build 567 B

123456789101112131415161718
  1. #!/bin/bash -e
  2. ORG_PATH="github.com/coreos"
  3. REPO_PATH="${ORG_PATH}/etcd"
  4. export GOPATH=${PWD}/gopath
  5. rm -f $GOPATH/src/${REPO_PATH}
  6. mkdir -p $GOPATH/src/${ORG_PATH}
  7. ln -s ${PWD} $GOPATH/src/${REPO_PATH}
  8. eval $(go env)
  9. GIT_SHA=`git rev-parse --short HEAD || echo "GitNotFound"`
  10. # Static compilation is useful when etcd is run in a container
  11. CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags "-s -X ${REPO_PATH}/version.GitSHA ${GIT_SHA}" -o bin/etcd ${REPO_PATH}
  12. CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags "-s" -o bin/etcdctl ${REPO_PATH}/etcdctl