Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from cabify/add_makefile
Browse files Browse the repository at this point in the history
Add project Makefile
  • Loading branch information
jesusvazquez committed Oct 2, 2017
2 parents 715d111 + cc4b29a commit 912f55e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,4 +353,13 @@ $ couchdb-admin describe_db --db=mydb

`couchdb-admin` currently uses [Glide](http:https://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.
23 changes: 23 additions & 0 deletions cli/couchdb-admin/Makefile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion cli/couchdb-admin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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: "[email protected]"}}

app.Flags = []cli.Flag{
Expand Down

0 comments on commit 912f55e

Please sign in to comment.