etcd/third_party/update
Brandon Philips 5f6d331e6a 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.
2013-08-06 11:38:43 -07:00

47 lines
921 B
Bash
Executable File

#!/bin/sh
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
"
export GOPATH=${PWD}
for p in $packages; do
# this is the target directory
mkdir -p $p
# This will checkout the project into src
go get -u -d $p
# 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
HEAD=$(git --git-dir=$gp/.git rev-parse HEAD)
fi
# Grab the head if it is mercurial
if [ -d $gp/.hg ]; then
cd $gp
HEAD=$(hg id -i)
cd -
fi
# 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