-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
71 lines (54 loc) · 2.2 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
SHELL=/bin/bash
GO_BUILD_DIR?=build/
ldflags := -X 'github.com/livepeer/stream-tester/model.Version=$(shell git describe --dirty)'
all: streamtester loadtester testdriver lapi mapi recordtester
# ldflags := -X 'github.com/livepeer/stream-tester/model.Version=$(shell git describe --dirty)' -X 'github.com/livepeer/stream-tester/model.IProduction=true'
.PHONE: test
test:
go test $(shell go list ./... | grep -v "orch-tester") --short -v --covermode=atomic --coverprofile=coverage.out --coverpkg=./...
.PHONY: streamtester
streamtester:
go build -ldflags="$(ldflags)" -o "$(GO_BUILD_DIR)" cmd/streamtester/streamtester.go
.PHONY: loadtester
loadtester:
go build -ldflags="$(ldflags)" -o "$(GO_BUILD_DIR)" cmd/loadtester/loadtester.go
.PHONY: testdriver
testdriver:
go build -ldflags="$(ldflags)" -o "$(GO_BUILD_DIR)" cmd/testdriver/testdriver.go
.PHONY: lapi
lapi:
go build -ldflags="$(ldflags)" -o "$(GO_BUILD_DIR)" cmd/lapi/lapi.go
.PHONY: mapi
mapi:
go build -ldflags="$(ldflags)" -o "$(GO_BUILD_DIR)" cmd/mapi/mapi.go
.PHONY: recordtester
recordtester:
go build -ldflags="$(ldflags)" -o "$(GO_BUILD_DIR)" cmd/recordtester/recordtester.go
.PHONY: stream-monitor
monitor:
go build -ldflags="$(ldflags)" -o "$(GO_BUILD_DIR)" cmd/stream-monitor/stream-monitor.go
.PHONY: api-transcoder
api-transcoder:
go build -ldflags="$(ldflags)" cmd/api-transcoder/api-transcoder.go
.PHONY: webrtc-load-tester
webrtc-load-tester:
go build -ldflags="$(ldflags)" -o "$(GO_BUILD_DIR)" cmd/webrtc-load-tester/webrtc-load-tester.go
.PHONY: docker
docker:
docker build -f docker/Dockerfile -t livepeer/streamtester:latest --build-arg version=$(shell git describe --dirty) .
.PHONY: push
push:
docker push livepeer/streamtester:latest
.PHONY: release
release:
@if [[ ! "$(version)" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-.+)?$$ ]]; then \
echo "Must provide semantic version as arg to make." ; \
echo "e.g. make release version=1.2.3-beta" ; \
exit 1 ; \
fi
@git diff --quiet || { echo "Git working directory is dirty."; exit 1 ; }
git tag -a v$(version) -m "Release v$(version)"
git push origin v$(version)
.PHONY: webrtc-load-test
webrtc-load-test:
go run cmd/webrtc-load-tester/webrtc-load-tester.go orchestrator -config webrtc-load-tester.conf