From b0658fe9420a9db9cfd157d7af34ea29240100f4 Mon Sep 17 00:00:00 2001 From: Jesus Vazquez Date: Mon, 2 Oct 2017 15:18:37 +0200 Subject: [PATCH 1/2] Upgrade couchdb-admin version to 0.1.0 --- cli/couchdb-admin/Makefile | 23 +++++++++++++++++++++++ cli/couchdb-admin/main.go | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 cli/couchdb-admin/Makefile diff --git a/cli/couchdb-admin/Makefile b/cli/couchdb-admin/Makefile new file mode 100644 index 0000000..cae815e --- /dev/null +++ b/cli/couchdb-admin/Makefile @@ -0,0 +1,23 @@ +GOARCH = amd64 +PREFIX = "couchdb-admin" +VERSION?=? +COMMIT=$(shell git rev-parse HEAD) +BRANCH=$(shell git rev-parse --abbrev-ref HEAD) + +LDFLAGS = -ldflags "-X main.VERSION=${VERSION} -X main.COMMIT=${COMMIT} -X main.BRANCH=${BRANCH}" + +all: clean default + +default: + GOOS=linux GOARCH=${GOARCH} go build ${LDFLAGS} -o ${PREFIX} + +linux: + GOOS=linux GOARCH=${GOARCH} go build ${LDFLAGS} -o ${PREFIX}-linux-${GOARCH} + +darwin: + GOOS=darwin GOARCH=${GOARCH} go build ${LDFLAGS} -o ${PREFIX}-darwin-${GOARCH} + +clean: + -rm -f ${PREFIX}* + +.PHONY: default linux darwin clean diff --git a/cli/couchdb-admin/main.go b/cli/couchdb-admin/main.go index 4cf2b1d..7342f19 100644 --- a/cli/couchdb-admin/main.go +++ b/cli/couchdb-admin/main.go @@ -16,7 +16,7 @@ func main() { app.Name = "CouchDB 2 Admin tool" app.Usage = "Easily operate a CouchDB 2 cluster" app.UsageText = "$ couchdb-admin [COMMAND] [OPTIONS]" - app.Version = "0.0.1" + app.Version = "0.1.0" app.Authors = []cli.Author{cli.Author{Name: "Carlos Alonso", Email: "carlos.alonso@cabify.com"}} app.Flags = []cli.Flag{ From cc4b29a62e75c54cbc36d8eee4ec9330d3a1db5b Mon Sep 17 00:00:00 2001 From: Jesus Vazquez Date: Mon, 2 Oct 2017 16:08:28 +0200 Subject: [PATCH 2/2] Add developing couchdb-admin section to README --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index cb8c187..5549ae1 100644 --- a/README.md +++ b/README.md @@ -353,4 +353,13 @@ $ couchdb-admin describe_db --db=mydb `couchdb-admin` currently uses [Glide](http://glide.sh/) for vendoring. +## Developing couchdb-admin +If you wish to work on couchdb-admin you'll first need Go installed (version 1.8+ is required). Make sure you have Go properly installed, including setting up your GOPATH. + +Next, clone this repository into $GOPATH/src/github.com/cabify/couchdb-admin. Then enter into the directory `cli/couchdb-admin` and type: +``` +$ make all +``` + +This will generate a binary file `couchdb-admin` which you can now play with. In case you are running on macOS type `make darwin` instead.