-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
50 lines (40 loc) · 1.61 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
GO=go
DOCKER=docker
TARGET=zazkia
K6=$(DOCKER) run -i loadimpact/k6 run
.PHONY: build test clean
all: build
build: $(TARGET)
$(TARGET): *.go
$(GO) build
test: test1 test2 test3 test4
test1:
basicweb -port 8080 -dir ./tests & echo $$! > /tmp/basicweb.pid
@sed 's/__IP__/'$$(hostname -i)'/g' tests/test1.js | $(K6) -
@cat /tmp/basicweb.pid | xargs kill
@rm -f /tmp/basicweb.pid
test2:
basicweb -port 8080 -dir ./tests > /dev/null 2>&1 & echo $$! > /tmp/basicweb.pid
@./zazkia -c -p 9191 -f ./tests/test2.json > /dev/null 2>&1 & echo $$! > /tmp/zazkia.pid
@sed 's/__IP__/'$$(hostname -i)'/g' tests/test2.js | $(K6) -
@cat /tmp/basicweb.pid | xargs kill
@cat /tmp/zazkia.pid | xargs kill
@rm -f /tmp/basicweb.pid /tmp/zazkia.pid
test3:
basicweb -port 8080 -dir ./tests > /dev/null 2>&1 & echo $$! > /tmp/basicweb.pid
@./zazkia -c -p 9191 -f ./tests/test3.json > /dev/null 2>&1 & echo $$! > /tmp/zazkia.pid
@sed 's/__IP__/'$$(hostname -i)'/g' tests/test3.js | $(K6) -
@cat /tmp/basicweb.pid | xargs kill
@cat /tmp/zazkia.pid | xargs kill
@rm -f /tmp/basicweb.pid /tmp/zazkia.pid
test4:
basicweb -port 8080 -dir ./tests > /dev/null 2>&1 & echo $$! > /tmp/basicweb.pid
@./zazkia -c -p 9191 -f ./tests/test4.json > /dev/null 2>&1 & echo $$! > /tmp/zazkia.pid
@sed 's/__IP__/'$$(hostname -i)'/g' tests/test4.js | $(K6) -
@cat /tmp/basicweb.pid | xargs kill
@cat /tmp/zazkia.pid | xargs kill
@rm -f /tmp/basicweb.pid /tmp/zazkia.pid
clean:
$(DOCKER) system prune -f -a
if [ -f /tmp/basicweb.pid ] ; then cat /tmp/basicweb.pid | xargs kill ; fi
if [ -f /tmp/zazkia.pid ] ; then cat /tmp/zazkia.pid | xargs kill ; fi