-
Notifications
You must be signed in to change notification settings - Fork 472
/
Makefile
172 lines (138 loc) · 4.77 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
export GO15VENDOREXPERIMENT=1
exe = github.com/goss-org/goss/cmd/goss
pkgs = $(shell ./novendor.sh)
cmd = goss
GO111MODULE=on
GO_FILES = $(shell git ls-files -- '*.go' ':!:*vendor*_test.go')
VENV := $(shell echo $${VIRTUAL_ENV-.venv})
PYTHON := $(VENV)/bin/python
DOCS_DEPS := $(VENV)/.docs.dependencies
.PHONY: all build install test release bench fmt lint vet test-int-all gen centos7 wheezy trusty alpine3 arch test-int32 centos7-32 wheezy-32 trusty-32 alpine3-32 arch-32
all: test-short-all test-int-all dgoss-sha256 dcgoss-sha256 kgoss-sha256
test-short-all: fmt lint vet test
install: release/goss-linux-amd64
$(info INFO: Starting build $@)
cp release/$(cmd)-linux-amd64 $(GOPATH)/bin/goss
test:
$(info INFO: Starting build $@)
./ci/go-test.sh
cov:
go test -coverpkg=./... -coverprofile=c.out ./...
# go tool cover -func ./c.out
funcov:
go test -coverpkg=./... -coverprofile=c.out ./...
go tool cover -func ./c.out
htmlcov:
go test -v -coverpkg=./... -coverprofile=c.out ./...
go tool cover -html ./c.out
lint:
$(info INFO: Starting build $@)
go install github.com/golangci/golangci-lint/cmd/[email protected]
golangci-lint run --timeout 5m $(pkgs) || true
vet:
$(info INFO: Starting build $@)
go vet $(pkgs) || true
fmt:
$(info INFO: Starting build $@)
./ci/go-fmt.sh
bench:
$(info INFO: Starting build $@)
go test -bench=.
test-int-validate-%: release/goss-%
$(info INFO: Starting build $@)
./integration-tests/run-validate-tests.sh $*
test-int-serve-%: release/goss-%
$(info INFO: Starting build $@)
./integration-tests/run-serve-tests.sh $*
release/goss-%: $(GO_FILES)
./release-build.sh $*
release:
$(MAKE) clean
$(MAKE) build
build: release/goss-darwin-amd64 release/goss-darwin-arm64 release/goss-linux-386 release/goss-linux-amd64 release/goss-linux-arm release/goss-linux-arm64 release/goss-linux-s390x release/goss-windows-amd64
gen:
$(info INFO: Starting build $@)
go generate -tags genny $(pkgs)
clean:
$(info INFO: Starting build $@)
rm -rf ./release
rm -rf ./site
rm -rf ${VENV}
build-images:
$(info INFO: Starting build $@)
development/build_images.sh
push-images:
$(info INFO: Starting build $@)
development/push_images.sh
# Update the matcher test golden files
update-matcher-tests:
go test -v -run '^TestMatchers' . -update
test-darwin-all: test-short-all test-int-darwin-all
# linux _does_ have the docker-style testing, but does _not_ currently have the same style integration tests darwin+windows do, _because_ of the docker-style testing.
test-linux-all: test-short-all test-int-64 test-int-32
test-windows-all: test-short-all test-int-windows-all
test-int-64: rockylinux9 wheezy trusty alpine3 arch test-int-serve-linux-amd64
test-int-32: rockylinux9-32 wheezy-32 trusty-32 alpine3-32 arch-32
test-int-darwin-all: test-int-validate-darwin-amd64 test-int-serve-darwin-amd64
test-int-windows-all: test-int-validate-windows-amd64 test-int-serve-windows-amd64
test-int-all: test-int-32 test-int-64
centos7-32: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh centos7 386
.PHONY: rockylinux9-32
rockylinux9-32: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh rockylinux9 386
wheezy-32: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh wheezy 386
trusty-32: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh trusty 386
alpine3-32: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh alpine3 386
arch-32: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh arch 386
centos7: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh centos7 amd64
.PHONY: rockylinux9
rockylinux9: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh rockylinux9 amd64
wheezy: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh wheezy amd64
trusty: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh trusty amd64
alpine3: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh alpine3 amd64
arch: build
$(info INFO: Starting build $@)
cd integration-tests/ && ./test.sh arch amd64
dgoss-sha256:
cd extras/dgoss/ && sha256sum dgoss > dgoss.sha256
dcgoss-sha256:
cd extras/dcgoss/ && sha256sum dcgoss > dcgoss.sha256
kgoss-sha256:
cd extras/kgoss/ && sha256sum kgoss > kgoss.sha256
$(PYTHON):
$(info Creating virtualenv in $(VENV))
@python -m venv $(VENV)
$(DOCS_DEPS): $(PYTHON) docs/requirements.txt
$(info Installing dependencies)
@pip install --upgrade pip
@pip install --requirement docs/requirements.txt
@touch $(DOCS_DEPS)
docs/setup: $(DOCS_DEPS)
docs/serve: docs/setup
$(info Running documentation live development server)
@mkdocs serve --strict
.PHONY: docs
docs: docs/setup
$(info Building documentation)
@mkdocs build --strict