From 79455c3f9d932d90798f9b1be31bc861361dc284 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 18 Feb 2015 14:35:49 -0800 Subject: [PATCH] No symlink, fail when not in GOPATH --- CONTRIBUTING.md | 20 ++++++++++++++++++++ Makefile | 12 +++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cab38735b..d78404cb5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,8 @@ ### Setup your Minio Github Repository Fork [Minio upstream](https://github.com/Minio-io/minio/fork) source repository to your own personal repository. Copy the URL and pass it to ``go get`` command. Go uses git to clone a copy into your project workspace folder. ```sh +$ mkdir -p $GOPATH/src/github.com/minio-io +$ cd $GOPATH/src/github.com/minio-io $ git clone https://github.com/$USER_ID/minio $ cd minio ``` @@ -19,6 +21,24 @@ Building Libraries ... ``` +### Setting up git remote as ``upstream`` +```sh +$ cd $GOPATH/src/github.com/minio-io/minio +$ git remote add upstream https://github.com/minio-io/minio +$ git fetch upstream +$ git merge upstream/master +... +... +$ make +Checking if proper environment variables are set.. Done +... +Checking dependencies for Minio.. Done +Installed godep +Installed cover +Building Libraries +... +``` + ### Developer Guidelines ``Minio`` community welcomes your contribution. To make the process as seamless as possible, we ask for the following: * Go ahead and fork the project and make your changes. We encourage pull requests to discuss code changes. diff --git a/Makefile b/Makefile index 74b6767c3..447116d85 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,20 @@ +MINIOPATH=$(GOPATH)/src/github.com/minio-io/minio + all: getdeps install checkdeps: @echo "Checking deps.." @(env bash $(PWD)/devscripts/checkdeps.sh) -createsymlink: - @mkdir -p $(GOPATH)/src/github.com/minio-io/; - @if test ! -e $(GOPATH)/src/github.com/minio-io/minio; then echo "Creating symlink to $(GOPATH)/src/github.com/minio-io/minio" && ln -s $(PWD) $(GOPATH)/src/github.com/minio-io/minio; fi +checkgopath: + @echo "Checking project in ${MINIOPATH}" + @if [ ! -d ${MINIOPATH} ]; then echo "Project not found in $GOPATH, please follow instructions provided at https://github.com/Minio-io/minio/blob/master/CONTRIBUTING.md#setup-your-minio-github-repository" && exit 1; fi -getdeps: checkdeps +getdeps: checkdeps checkgopath @go get github.com/tools/godep && echo "Installed godep" @go get golang.org/x/tools/cmd/cover && echo "Installed cover" -build-all: getdeps createsymlink +build-all: getdeps @echo "Building Libraries" @godep go generate ./... @godep go build ./...