From 5f6d331e6ab653da376af4743af562f36fd49a30 Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Tue, 6 Aug 2013 11:19:19 -0700 Subject: [PATCH] feat(third_party): use this directory The third_party directory has all of the dependencies needed to build etcd so that we can have a consistent build. `go get` should not be called at any point during the build process. --- build | 10 ++++++++-- third_party/.gitignore | 2 +- third_party/README | 11 +++++++++++ third_party/update | 6 +++++- 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 third_party/README diff --git a/build b/build index f68b2646b..26a0cf4bc 100755 --- a/build +++ b/build @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash ETCD_PACKAGE=github.com/coreos/etcd export GOPATH=${PWD} @@ -14,5 +14,11 @@ if [ ! -h ${ETCD_DIR} ]; then ln -s ../../../ ${ETCD_DIR} fi -go get -d ./... +for i in third_party/*; do + if [ $i = "third_party/src" ]; then + continue + fi + cp -R $i src/ +done + go build ${ETCD_PACKAGE} diff --git a/third_party/.gitignore b/third_party/.gitignore index 85de9cf93..8eba6c8dd 100644 --- a/third_party/.gitignore +++ b/third_party/.gitignore @@ -1 +1 @@ -src +src/ diff --git a/third_party/README b/third_party/README new file mode 100644 index 000000000..b568b479e --- /dev/null +++ b/third_party/README @@ -0,0 +1,11 @@ +# Third Party Libraries + +The third_party directory has all of the dependencies needed to build +etcd so that we can have a consistent build. `go get` should not be +called at any point during the build process. + +## Usage + +To update all of the third party libraries call + + ./update diff --git a/third_party/update b/third_party/update index ed5603761..c15bbd882 100755 --- a/third_party/update +++ b/third_party/update @@ -2,7 +2,10 @@ packages=" github.com/coreos/go-raft + github.com/coreos/go-etcd + github.com/benbjohnson/go-raft github.com/ccding/go-logging + github.com/ccding/go-config-reader bitbucket.org/kardianos/osext code.google.com/p/go.net code.google.com/p/goprotobuf @@ -20,6 +23,7 @@ for p in $packages; do # The go get path gp=src/$p + # Attempt to find the commit hash of the repo HEAD= if [ -d $gp/.git ]; then # Grab the head if it is git @@ -36,7 +40,7 @@ for p in $packages; do # Copy the code into the final directory rsync -a -z -r --exclude '.git/' --exclude '.hg/' src/$p/ $p + # Make a nice commit about what everything bumped to git add $p - git commit -m "bump($p): $HEAD" done