-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (47 loc) · 1.2 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
BINARIES=$$(go list ./cmd/...)
TESTABLE=$$(go list ./... | grep -v /vendor/)
all: vet test build clean
deps:
@dep ensure && dep ensure -update
.PHONY: deps
build:
@go install -v $(BINARIES)
.PHONY: build
test:
@go test -v $(TESTABLE)
.PHONY: test
vet:
@go vet $(TESTABLE)
.PHONY: vet
fmt:
@goimports -w $$(find . -type f -name '*.go' -not -path "./vendor/*")
.PHONY: fmt
lint:
@golint $(TESTABLE)
.PHONY: lint
clean:
@go clean
.PHONY: clean
local: all
@heroku local web
docker-build:
@cd cmd/$(SERVICE) && \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o main && \
docker build -t eu.gcr.io/accuport-prod/$(SERVICE):$(TAG) . && \
docker tag eu.gcr.io/accuport-prod/$(SERVICE):$(TAG) eu.gcr.io/accuport-prod/$(SERVICE):latest && \
rm main
.PHONY: docker-build
docker-push:
@docker push eu.gcr.io/accuport-prod/$(SERVICE):$(TAG)
.PHONY: docker-push
k8s-deploy:
@helm upgrade accuport-api k8s/charts/accuport --set hash=$(TAG) --install
.PHONY: k8s-deploy
k8s-delete:
@helm delete accuport-api --purge
.PHONY: k8s-delete
k8s-deploy-dry:
@helm upgrade accuport-api k8s/charts/accuport --set hash=$(TAG) --dry-run --debug
.PHONY: k8s-deploy
ship: docker-build docker-push k8s-deploy
.PHONY: ship