From 1eb0be10fe9ebf6e99a6c16abd3e583a68533dbd Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Wed, 10 Jul 2013 15:37:17 -0700 Subject: [PATCH] feat(build): add initial build script add a simple build script that sets up a gopath and uses the current git directory for the github.com/coreos/etcd packages. There aren't a lot of great alternatives to doing it this way unless we want to check in all of the dependencies into the repo (which is actually a good practice probably). --- .gitignore | 2 ++ build | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 .gitignore create mode 100755 build diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..296810f46 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +src +etcd diff --git a/build b/build new file mode 100755 index 000000000..1b29875aa --- /dev/null +++ b/build @@ -0,0 +1,18 @@ +#!/bin/sh + +ETCD_PACKAGE=github.com/coreos/etcd +GOPATH=${PWD} +SRC_DIR=$GOPATH/src +ETCD_DIR=$SRC_DIR/$ETCD_PACKAGE + +ETCD_BASE=$(dirname ${ETCD_DIR}) +if [ ! -d ${ETCD_BASE} ]; then + mkdir -p ${ETCD_BASE} +fi + +if [ ! -h ${ETCD_DIR} ]; then + ln -s ../../../ ${ETCD_DIR} +fi + +go get -d ./... +go build ${ETCD_PACKAGE}