-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
97 lines (77 loc) · 2.24 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Makefile adapted from https://github.com/thockin/go-build-template
# Released under the Apache-2.0 license.
DBG_MAKEFILE ?=
ifeq ($(DBG_MAKEFILE),1)
$(warning ***** starting Makefile for goal(s) "$(MAKECMDGOALS)")
$(warning ***** $(shell date))
else
# If we're not debugging the Makefile, don't echo recipes.
MAKEFLAGS += -s
endif
DBG ?=
# We don't need make's built-in rules.
MAKEFLAGS += --no-builtin-rules
# Be pedantic about undefined variables.
MAKEFLAGS += --warn-undefined-variables
OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS))
ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH))
GOBIN ?= "go"
GOFLAGS ?=
HTTP_PROXY ?=
HTTPS_PROXY ?=
default: verify
test: # @HELP run tests
test:
./scripts/test.sh
autotest: # @HELP run tests on file changes
autotest:
./scripts/autotest.sh
cover: # @HELP run tests with coverage and open HTML report
cover:
./scripts/cover.sh
lint: # @HELP run all linting
lint: lint-go lint-yaml lint-schema lint-ci lint-docs
lint-go: # @HELP run Go linting
lint-go:
./scripts/lint-go.sh
lint-yaml: # @HELP run YAML linting
lint-yaml:
./scripts/lint-yaml.sh
lint-schema: # @HELP run JSON schema linting
lint-schema:
./scripts/lint-schema.sh
lint-ci: # @HELP run linting on CI workflow files
lint-ci:
./scripts/lint-ci.sh
lint-docs: # @HELP run documentation linting
lint-docs:
./scripts/lint-docs.sh
verify: # @HELP run all tests and linters (default target)
verify: test lint
build: # @HELP build a snapshot binary for current OS and ARCH in ./dist/
build:
./scripts/build.sh
next-version: # @HELP determine the next version for a release
next-version:
${GOBIN} run github.com/caarlos0/svu@latest next
gen-docs: # @HELP generate documentation
gen-docs:
./scripts/gen-docs.sh
reset-golden: # @HELP remove all generated golden test files
reset-golden:
./scripts/reset-golden.sh
help: # @HELP print this message
help:
echo "VARIABLES:"
echo " OS = $(OS)"
echo " ARCH = $(ARCH)"
echo " GOBIN = $(GOBIN)"
echo " GOFLAGS = $(GOFLAGS)"
echo " DBG = $(DBG)"
echo
echo "TARGETS:"
grep -E '^.*: *# *@HELP' $(MAKEFILE_LIST) \
| awk ' \
BEGIN {FS = ": *# *@HELP"}; \
{ printf " %-20s$ %s\n", $$1, $$2 }; \
'