-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (25 loc) · 691 Bytes
/
Makefile
File metadata and controls
32 lines (25 loc) · 691 Bytes
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
.PHONY: all generate clean
UID := $(shell id -u)
API_URL := https://infrahub-api-doc.nexgencloud.com/api.json
all: generate
generate: api.json
docker container run \
--rm \
--user $(UID) \
--tty \
--interactive \
--volume "$(PWD):/local" \
openapitools/openapi-generator-cli \
generate \
--generator-name python \
--input-spec "/local/api.json" \
--output /local/ \
--config /local/config.json
api.orig.json:
curl "$(API_URL)" | jq . > api.orig.json
api.json: api.orig.json patch.jq
jq -f 'patch.jq' api.orig.json > api.json
api.patch: api.orig.json api.json
diff -u5 api.orig.json api.json > api.patch || true
clean:
rm -f api.orig.json api.json api.patch