-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
38 lines (31 loc) · 1017 Bytes
/
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
generator-dir := generator
generator-config := $(addprefix $(generator-dir)/,typescript-fetch.config.yaml)
spec-openapi := $(addprefix ${generator-dir}/,openapi.yml)
api-dest := .
OPEN_API_URL = https://timeside.ircam.fr/api/schema/
all: install api
install:
# Check docker
ifeq (, $(shell which docker))
$(error No "docker" in PATH, consider doing apt install docker)
endif
# Log dependencies' version
docker --version
$(spec-openapi):
curl --fail $(OPEN_API_URL) -o $(spec-openapi)
api: $(spec-openapi)
docker run --rm \
-v ${PWD}:/local \
--user "$$(id -u):$$(id -g)" \
openapitools/openapi-generator-cli:v4.3.0 generate \
-i /local/$(spec-openapi) \
-g typescript-fetch \
-c /local/$(generator-config) \
-o /local/$(api-dest)
publish:
cd $(api-dest)
npm install
# No need for this because the prepare script is called after install and before publish
# npm run build
npm publish --access public
.PHONY: all install publish api