-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·75 lines (64 loc) · 2.18 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
75
# ==================================================================================== #
# HELPERS
# ==================================================================================== #
## help: print this help message
.PHONY: help
help:
@echo 'Usage:'
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
## licenses-report: generate a report of all licenses
.PHONY: licenses-report
licenses-report:
ifeq ($(SKIP_LICENSES_REPORT), true)
@echo "Skipping licenses report"
rm -rf ./licenses && mkdir -p ./licenses
else
@echo "Generating licenses report"
rm -rf ./licenses
go run github.com/google/[email protected] save . --save_path ./licenses
go run github.com/google/[email protected] report . > ./licenses/THIRD-PARTY.csv
cp LICENSE ./licenses/LICENSE.txt
endif
# ==================================================================================== #
# QUALITY CONTROL
# ==================================================================================== #
## tidy: format code and tidy modfile
.PHONY: tidy
tidy:
go fmt ./...
go mod tidy -v
## audit: run quality control checks
.PHONY: audit
audit:
go vet ./...
go run honnef.co/go/tools/cmd/staticcheck@latest -checks=all,-SA1019,-ST1000,-ST1003,-U1000 ./...
go test -race -vet=off -coverprofile=coverage.out ./...
go mod verify
## charttesting: Run Helm chart unit tests
.PHONY: charttesting
charttesting:
echo "No helm chart"
## chartlint: Lint charts
.PHONY: chartlint
chartlint:
echo "No helm chart"
## chart-bump-version: Bump the patch version and optionally set the appVersion
.PHONY: chart-bump-version
chart-bump-version:
echo "No helm chart"
# ==================================================================================== #
# BUILD
# ==================================================================================== #
## build: build the extension
.PHONY: build
build:
go mod verify
go build -o=./extension
## run: run the extension
.PHONY: run
run: tidy build
./extension
## container: build the container image
.PHONY: container
container:
docker build --build-arg ADDITIONAL_BUILD_PARAMS="-cover -covermode=atomic" --build-arg SKIP_LICENSES_REPORT="true" -t extension-auto-registration-ecs:latest .