-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
66 lines (47 loc) · 1.5 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
APPLICATION = ipam
ORGANIZATION = RackHD
TTY = $(shell if [ -t 0 ]; then echo "-ti"; fi)
DOCKER_DIR = /go/src/github.com/${ORGANIZATION}/${APPLICATION}
DOCKER_IMAGE = rackhd/golang:1.7.1-wheezy
DOCKER_CMD = docker run ${TTY} --rm -v ${PWD}:${DOCKER_DIR} -w ${DOCKER_DIR} ${DOCKER_IMAGE}
.PHONY: shell deps deps-local build build-local lint lint-local test test-local release
default: deps test build
shell:
@docker run --rm -ti -v ${PWD}:${DOCKER_DIR} -w ${DOCKER_DIR} ${DOCKER_IMAGE} /bin/bash
deps:
@${DOCKER_CMD} make deps-local
deps-local:
@if ! [ -f glide.yaml ]; then glide init --non-interactive; fi
@glide install
build:
@${DOCKER_CMD} make build-local
build-local:
@go build -o bin/${APPLICATION} main.go
lint:
@${DOCKER_CMD} make lint-local
lint-local:
@gometalinter --vendor --fast --disable=dupl --disable=gotype --skip=grpc ./...
test:
@${DOCKER_CMD} make test-local
test-client:
@docker-compose build
@docker-compose create
@docker-compose start
@-make test-client-local
@docker-compose kill
test-local: lint-local
@ginkgo -race -trace -randomizeAllSpecs -r -cover --skipPackage=client
test-client-local:
@ginkgo -race -trace -randomizeAllSpecs -cover client
coveralls:
@go get github.com/mattn/goveralls
@go get github.com/modocache/gover
@go get golang.org/x/tools/cmd/cover
@gover
@goveralls -coverprofile=gover.coverprofile -service=travis-ci
release: build
@docker build -t rackhd/${APPLICATION} .
run: release
@docker-compose up
mongo:
@docker exec -it mongodb mongo ipam