-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (54 loc) · 1.65 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
TESTING_CONF = kong_TEST.yml
DEVELOPMENT_CONF = kong_DEVELOPMENT.yml
DEV_ROCKS=busted luacov luacov-coveralls luacheck
.PHONY: install dev clean start restart seed drop lint test test-integration test-plugins test-all coverage
install:
@if [ `uname` = "Darwin" ]; then \
luarocks make kong-*.rockspec; \
else \
luarocks make kong-*.rockspec \
PCRE_LIBDIR=`find / -type f -name "libpcre.so*" -print -quit | xargs dirname` \
OPENSSL_LIBDIR=`find / -type f -name "libssl.so*" -print -quit | xargs dirname`; \
fi
dev: install
@for rock in $(DEV_ROCKS) ; do \
if ! command -v $$rock &> /dev/null ; then \
echo $$rock not found, installing via luarocks... ; \
luarocks install $$rock ; \
else \
echo $$rock already installed, skipping ; \
fi \
done;
bin/kong config -c kong.yml -e TEST
bin/kong config -c kong.yml -e DEVELOPMENT
bin/kong migrations -c $(DEVELOPMENT_CONF) up
clean:
@bin/kong migrations -c $(DEVELOPMENT_CONF) reset
rm -f $(DEVELOPMENT_CONF) $(TESTING_CONF)
rm -f luacov.*
rm -rf nginx_tmp
start:
@bin/kong start -c $(DEVELOPMENT_CONF)
stop:
@bin/kong stop -c $(DEVELOPMENT_CONF)
restart:
@bin/kong restart -c $(DEVELOPMENT_CONF)
seed:
@bin/kong db -c $(DEVELOPMENT_CONF) seed
drop:
@bin/kong db -c $(DEVELOPMENT_CONF) drop
lint:
@find kong spec -name '*.lua' -not -name 'invalid-module.lua' -not -path 'kong/vendor/*' | xargs luacheck -q
test:
@busted -v spec/unit
test-integration:
@busted -v spec/integration
test-plugins:
@busted -v spec/plugins
test-all:
@busted -v spec/
coverage:
@rm -f luacov.*
@busted --coverage spec/
@luacov -c spec/.luacov
@tail -n 1 luacov.report.out | awk '{ print $$3 }'