-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
52 lines (36 loc) · 1.54 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
export CGO_ENABLED=0
export GO111MODULE=on
ATOMIX_REDIS_CONTROLLER_VERSION := latest
.PHONY: build
test: # @HELP run the unit tests and source code validation
test: build linters
go test github.com/atomix/redis-storage-controller/pkg/...
coverage: # @HELP generate unit test coverage data
coverage: build linters license_check
build: # @HELP build the source code
build: deps
GOOS=linux GOARCH=amd64 go build -o build/_output/redis-storage-controller ./cmd/redis-storage-controller
deps: # @HELP ensure that the required dependencies are in place
go build -v ./...
bash -c "diff -u <(echo -n) <(git diff go.mod)"
bash -c "diff -u <(echo -n) <(git diff go.sum)"
linters: # @HELP examines Go source code and reports coding problems
GOGC=50 golangci-lint run
license_check: # @HELP examine and ensure license headers exist
@if [ ! -d "../build-tools" ]; then cd .. && git clone https://github.com/onosproject/build-tools.git; fi
./../build-tools/licensing/boilerplate.py -v --rootdir=${CURDIR}
images: # @HELP build redis-storage Docker image
image: build
docker build . -f build/redis-storage-controller/Dockerfile -t atomix/redis-storage-controller:${ATOMIX_REDIS_CONTROLLER_VERSION}
kind: image
kind load docker-image atomix/redis-storage-controller:${ATOMIX_REDIS_CONTROLLER_VERSION}
all: test
clean: # @HELP remove all the build artifacts
rm -rf ./build/_output ./vendor
help:
@grep -E '^.*: *# *@HELP' $(MAKEFILE_LIST) \
| sort \
| awk ' \
BEGIN {FS = ": *# *@HELP"}; \
{printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}; \
'