-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
74 lines (54 loc) · 1.44 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
67
68
69
70
71
72
73
74
GOENV ?= GO15VENDOREXPERIMENT=1
GODEP ?= $(GOENV) godep
GO ?= $(GOENV) go
SOURCES := $(shell find . -name "*.go")
PORT ?= 8000
all: build
run: up
up:
docker-compose up -d --force-recreate --remove-orphans
.PHONY: build
build: moul-as-a-service
.PHONY: test
test:
$(GODEP) restore
$(GO) get -t .
$(GO) test -v .
.PHONY: cover
cover:
rm -f profile.out
$(GO) test -covermode=count -coverpkg=. -coverprofile=profile.out
.PHONY: godep-save
godep-save:
$(GODEP) save $(shell go list ./... | grep -v /vendor/)
.PHONY: cover
rm -f profile.out
$(GO) test -covermode=count -coverpkg=. -coverprofile=profile.out
.PHONY: convey
convey:
$(GO) get github.com/smartysteets/goconvey
$(GOENV) goconvey -cover -port=9032 -workDir="$(shell realpath .)" -depth=-1
.PHONY: clean
clean:
rm -rf moul-as-a-service
moul-as-a-service: $(SOURCES)
$(GO) build -o $@ ./cmd/$@
.PHONY: goapp_serve
goapp_serve:
$(GOENV) goapp serve ./appspot/app.yaml
.PHONY: goapp_deploy
goapp_deploy:
$(GOENV) goapp deploy -application moul-as-a-service ./appspot/app.yaml
.PHONY: gin
gin:
$(GO) get ./...
$(GO) get github.com/codegangsta/gin
cd ./cmd/moul-as-a-service; $(GOENV) gin --immediate --port=$(PORT) server
.PHONY: heroku_deploy
heroku_deploy:
git remote add heroku https://git.heroku.com/moul-as-a-service || true
git push heroku master
.PHONY: dokku_deploy
dokku_deploy:
git remote add dokku [email protected]:moul-as-a-service || true
git push dokku master