-
Notifications
You must be signed in to change notification settings - Fork 208
/
Makefile
82 lines (66 loc) · 2.42 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
hoverfly-test:
cd core && \
go test -v $$(go list ./... | grep -v -E 'vendor')
hoverctl-test:
cd hoverctl && \
go test -v $$(go list ./... | grep -v -E 'vendor')
hoverfly-build: hoverfly-test
cd core/cmd/hoverfly && \
go build -o ../../../target/hoverfly
hoverctl-build: hoverctl-test
cd hoverctl && \
go build -ldflags "-X main.hoverctlVersion=$(GIT_TAG_NAME)" -o ../target/hoverctl
CORE_FUNCTIONAL_TESTS = $(shell cd functional-tests/core && go list ./...)
hoverfly-functional-test: hoverfly-build
rm -f functional-tests/core/bin/hoverfly
cp target/hoverfly functional-tests/core/bin/hoverfly
cd functional-tests/core && \
go test -v $(CORE_FUNCTIONAL_TESTS)
hoverctl-functional-test:
rm -f functional-tests/hoverctl/bin/hoverfly
cp target/hoverfly functional-tests/hoverctl/bin/hoverfly
cd functional-tests/hoverctl && \
go test -v $(go list ./... | grep -v -E 'vendor')
vet:
go vet ./...
test: vet hoverfly-functional-test hoverctl-test hoverctl-functional-test
build:
cd core/cmd/hoverfly && \
go build -o ../../../target/hoverfly
cd hoverctl && \
go build -ldflags "-X main.hoverctlVersion=$(GIT_TAG_NAME)" -o ../target/hoverctl
build-ui:
wget https://github.com/SpectoLabs/hoverfly-ui/releases/download/$(GIT_TAG_NAME)/$(GIT_TAG_NAME).zip
unzip $(GIT_TAG_NAME).zip -d hoverfly-ui
cd core && \
statik -src=../hoverfly-ui
rm -rf $(GIT_TAG_NAME).zip
rm -rf hoverfly-ui
build-docs:
cd docs && \
make clean html
benchmark:
cd core && \
go test -bench=BenchmarkProcessRequest -run=XXX -cpuprofile profile_cpu.out -memprofile profile_mem.out --benchtime=20s
fmt:
go fmt $$(go list ./... | grep -v -E 'vendor')
update-dependencies:
godep save -t ./...
update-version:
awk \
-v line=$$(awk '/hoverfly.version/{print NR; exit}' core/hoverfly.go) \
-v version=${VERSION} \
'{ if (NR == line) print " hoverfly.version = \"${VERSION}\""; else print $0}' core/hoverfly.go > core/hoverfly2.go
rm -rf core/hoverfly.go
mv core/hoverfly2.go core/hoverfly.go
git add core/hoverfly.go
awk \
-v line=$$(awk '/version/{print NR; exit}' docs/conf.py) \
-v version=${VERSION} \
'{ if (NR == line) print "version = \x27${VERSION}\x27"; else print $0}' docs/conf.py > docs/conf2.py
rm -rf docs/conf.py
mv docs/conf2.py docs/conf.py
git add docs/conf.py
target/hoverctl > docs/pages/reference/hoverctl/hoverctl.output
git add docs/pages/reference/hoverctl/hoverctl.output
git commit -m "Updated hoverfly version to ${VERSION}"