This repository has been archived by the owner on Nov 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
72 lines (59 loc) · 1.84 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
GO_FILES?=$$(find . -name '*.go' |grep -v vendor)
TAG?=latest
SQUASH?=false
VERSION?=0.1.1
default: lint vet build test
.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 openfaas/faas-federation:$(TAG) . --squash=${SQUASH}
.PHONY: build-local
build-local:
go build --ldflags "-s -w \
-X github.com/openfaas-incubator/faas-federation/version.GitCommitSHA=${GIT_COMMIT_SHA} \
-X \"github.com/openfaas-incubator/faas-federation/version.GitCommitMessage=${GIT_COMMIT_MESSAGE}\" \
-X github.com/openfaas-incubator/faas-federation/version.Version=${VERSION}" \
-o faas-federation .
.PHONY: up-local
up: build
docker stack deploy federation --compose-file ./docker-compose.yml
.PHONY: push
push:
docker tag openfaas/faas-federation:latest openfaas/faas-federation:${VERSION}
docker push openfaas/faas-federation:${VERSION}
.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/ | grep -v examples/) ; 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 ."
@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