-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (29 loc) · 1.45 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
IMAGE_ID := ghcr.io/hexlet-components/rest-api-example
PORT := 5037
setup:
npm ci
make compile
compile:
npx tsp compile ./typespec/http-api/main.tsp --output-dir "./tsp-output/http-api"
npx tsp compile ./typespec/postman/main.tsp --output-dir "./tsp-output/postman"
npx tsp compile ./typespec/http-protocol/main.tsp --output-dir "./tsp-output/http-protocol"
npx tsp compile ./typespec/js-playwright/main.tsp --output-dir "./tsp-output/js-playwright"
dev:
docker rm -f rest-api-example
docker run -e PORT=$(PORT) -v ./custom-server:/custom-server -p $(PORT):$(PORT) --name rest-api-example $(IMAGE_ID)
start:
prism mock -m -d --json-schema-faker-fillProperties=false -p 4011 --host 0.0.0.0 ./tsp-output/http-api/@typespec/openapi3/openapi.1.0.yaml &
prism mock -m -d --json-schema-faker-fillProperties=false -p 4012 --host 0.0.0.0 ./tsp-output/http-protocol/@typespec/openapi3/openapi.1.0.yaml &
prism mock -m -d --json-schema-faker-fillProperties=false -p 4013 --host 0.0.0.0 ./tsp-output/js-playwright/@typespec/openapi3/openapi.1.0.yaml &
prism mock -m -d --json-schema-faker-fillProperties=false -p 4014 --host 0.0.0.0 ./tsp-output/postman/@typespec/openapi3/openapi.1.0.yaml &
npm start &
caddy run
test:
echo no tests
docker-build:
docker build . -t $(IMAGE_ID)
docker-run:
docker rm -f rest-api-example
docker run -e PORT=$(PORT) -p $(PORT):$(PORT) --name rest-api-example $(IMAGE_ID)
docker-sh:
docker run -e PORT=$(PORT) -it --entrypoint sh $(IMAGE_ID)