-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile.devhelpers
58 lines (34 loc) · 1.32 KB
/
Makefile.devhelpers
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
DATABASE_URL := postgresql://postgres:[email protected]:5432/postgres
FLASK_APP := dashdotdb
venv-init:
python3 -m venv venv && \
source venv/bin/activate && \
python3 setup.py develop
run-service:
FLASK_APP=$(FLASK_APP) DASHDOTDB_DATABASE_URL=$(DATABASE_URL) flask run --debugger --port 8080
db-down:
docker rm -f dashdot-postgres
db-up:
docker run -d --name dashdot-postgres --rm -it -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres
sleep 2
db-capture:
FLASK_APP=$(FLASK_APP) DASHDOTDB_DATABASE_URL=$(DATABASE_URL) flask db migrate
db-init:
FLASK_APP=$(FLASK_APP) DASHDOTDB_DATABASE_URL=$(DATABASE_URL) flask db upgrade
db: db-down db-up db-init db-capture db-init
dddb-import-imv:
curl --request POST \
--header "Content-Type: application/json" \
--data @examples/imagemanifestvuln.json \
localhost:8080/api/v1/imagemanifestvuln/app-sre-prod-01
dddb-query-imv:
curl "localhost:8080/api/v1/imagemanifestvuln?cluster=app-sre-prod-01&namespace=cso"
dddb-import-dv:
curl --request POST \
--header "Content-Type: application/json" \
--data @examples/deploymentvalidation.json \
localhost:8080/api/v1/deploymentvalidation/app-sre-prod-01
dddb-query-dv:
curl "localhost:8080/api/v1/deploymentvalidation?cluster=app-sre-prod-01&namespace=app-interface-stage"
dddb-metrics:
curl "localhost:8080/api/v1/metrics"