-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
46 lines (35 loc) · 1.07 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
.PHONY:
all: metering
metering: go.mod go.sum metering.go
go build -o build/ metering.go
.PHONY:
update: metering kong-restart
.PHONY:
kong-restart:
docker-compose restart kong
.PHONY:
kong-up: metering
docker-compose up -d
.PHONY:
kong-down:
docker-compose down
docker volume rm kong-plugin-amberflo_kong_data
.PHONY:
kong-init: setup-mockbin setup-mike enable-key-auth setup-metering
.PHONY:
setup-mockbin:
./scripts/admin.sh POST /services -d '{"name": "mockbin", "url": "http://mockbin.org"}'
./scripts/admin.sh POST /services/mockbin/routes -d '{"name": "mock", "paths": ["/mock"]}'
.PHONY:
setup-mike:
./scripts/admin.sh POST /consumers -d '{"username": "mike"}'
./scripts/admin.sh POST /consumers/mike/key-auth -d '{"key": "super-secret-key"}'
.PHONY:
enable-key-auth:
./scripts/admin.sh POST /plugins -d '{"name": "key-auth", "config": {"key_names": ["x-api-key"], "key_in_query": false}}'
.PHONY:
setup-metering:
./scripts/admin.sh POST /plugins -d @metering.json
.PHONY:
test-with-mike:
./scripts/test.sh GET /mock/requests -H 'x-api-key: super-secret-key' -i