forked from SpectoLabs/hoverfly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (54 loc) · 2.22 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
dependencies: hoverfly-dependencies hoverfly-functional-test-dependencies hoverctl-dependencies hoverctl-functional-test-dependencies
hoverfly-dependencies:
cd core && \
glide --quiet install
hoverctl-dependencies:
cd hoverctl && \
glide --quiet install
hoverfly-functional-test-dependencies:
cd functional-tests/core && \
glide --quiet install
hoverctl-functional-test-dependencies:
cd functional-tests/hoverctl && \
glide --quiet install
hoverfly-test: hoverfly-dependencies
cd core && \
go test -v $$(go list ./... | grep -v -E 'vendor')
hoverctl-test: hoverctl-dependencies
cd hoverctl && \
go test -v $$(go list ./... | grep -v -E 'vendor')
hoverfly-build: hoverfly-test
cd core/cmd/hoverfly && \
go build -ldflags "-X main.hoverflyVersion=$(GIT_TAG_NAME)" -o ../../../target/hoverfly
hoverctl-build: hoverctl-test
cd hoverctl && \
go build -ldflags "-X main.hoverctlVersion=$(GIT_TAG_NAME)" -o ../target/hoverctl
hoverfly-functional-test: hoverfly-functional-test-dependencies hoverfly-build
cp target/hoverfly functional-tests/core/bin/hoverfly
cd functional-tests/core && \
go test -v $(go list ./... | grep -v -E 'vendor')
hoverctl-functional-test: hoverctl-functional-test-dependencies hoverctl-build
cp target/hoverctl functional-tests/hoverctl/bin/hoverctl
cp target/hoverfly functional-tests/hoverctl/bin/hoverfly
cd functional-tests/hoverctl && \
go test -v $(go list ./... | grep -v -E 'vendor')
test: hoverfly-functional-test hoverctl-functional-test
build:
cd core/cmd/hoverfly && \
go build -ldflags "-X main.hoverflyVersion=$(GIT_TAG_NAME)" -o ../../../target/hoverfly
cd hoverctl && \
go build -ldflags "-X main.hoverctlVersion=$(GIT_TAG_NAME)" -o ../target/hoverctl
fmt:
go fmt $$(go list ./... | grep -v -E 'vendor')
update-version:
awk \
-v line=$$(awk '/h.version/{print NR; exit}' core/hoverfly.go) \
-v version=$(GIT_TAG_NAME) \
'{ if (NR == line) print " h.version = \"$(GIT_TAG_NAME)\""; else print $0}' core/hoverfly.go > core/hoverfly2.go
rm -rf core/hoverfly.go
mv core/hoverfly2.go core/hoverfly.go
git config --global user.email "[email protected]"
git config --global user.name "Benji Hooper"
git add core/hoverfly.go
git commit -m "Updated hoverfly version to $(GIT_TAG_NAME)"
git push