-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
67 lines (55 loc) · 1.67 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
GO_FILES?=$$(find . -name '*.go' |grep -v vendor)
TAG?=latest
SQUASH?=false
default: lint vet build test testacc
.PHONY: test
test: goimportscheck
go test -v . .
.PHONY: testacc
testacc: goimportscheck
go test -count=1 -v . -run="TestAcc" -timeout 20m
.PHONY: build
build:
docker build -t functions/faas-memory:$(TAG) . --squash=${SQUASH}
.PHONY: build-local
build-local:
GO111MODULE=off go build --ldflags "-s -w \
-X github.com/openfaas-incubator/faas-memory/version.GitCommitSHA=${GIT_COMMIT_SHA} \
-X \"github.com/openfaas-incubator/faas-memory/version.GitCommitMessage=${GIT_COMMIT_MESSAGE}\" \
-X github.com/openfaas-incubator/faas-memory/version.Version=${VERSION}" \
-o faas-memory .
.PHONY: start
start: build-local
port=8083 ./faas-memory
.PHONY: release
release:
go get github.com/goreleaser/goreleaser; \
goreleaser; \
.PHONY: clean
clean:
rm -rf pkg/
.PHONY: goimports
goimports:
goimports -w $(GO_FILES)
.PHONY: goimportscheck
goimportscheck:
@sh -c "'$(CURDIR)/scripts/goimportscheck.sh'"
.PHONY: vet
vet:
@echo "go vet ."
@go vet $$(go list ./... | grep -v vendor/) ; if [ $$? -eq 1 ]; then \
echo ""; \
echo "Vet found suspicious constructs. Please check the reported constructs"; \
echo "and fix them if necessary before submitting the code for review."; \
exit 1; \
fi
.PHONY: lint
lint:
@echo "golint ."
@go get golang.org/x/tools/cmd/goimports
@golint -set_exit_status $$(go list ./... | grep -v vendor/) ; if [ $$? -eq 1 ]; then \
echo ""; \
echo "Lint found errors in the source code. Please check the reported errors"; \
echo "and fix them if necessary before submitting the code for review."; \
exit 1; \
fi