-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (24 loc) · 987 Bytes
/
Makefile
File metadata and controls
32 lines (24 loc) · 987 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 remove
UID := $(shell id -u)
API_URL := https://infrahub-api-doc.nexgencloud.com/api.json
all: generate
generate: openapi/api.json
docker container run \
--rm \
--user $(UID) \
--tty \
--interactive \
--volume "$(PWD):/local" \
openapitools/openapi-generator-cli \
generate \
--config /local/openapi/config.yaml
openapi/api.orig.json:
curl "$(API_URL)" | jq . > openapi/api.orig.json
openapi/api.json: openapi/api.orig.json openapi/patch.jq
jq -f 'openapi/patch.jq' openapi/api.orig.json > openapi/api.json
openapi/api.patch: openapi/api.orig.json openapi/api.json
diff -u5 openapi/api.orig.json openapi/api.json > openapi/api.patch || true
clean:
rm -f openapi/api.orig.json openapi/api.json openapi/api.patch
remove:
rm -rf hyperstack docs test .github .openapi-generator .openapi-generator-ignore .gitlab-ci.yml .travis.yml README.md git_push.sh pyproject.toml requirements.txt setup.py setup.cfg test-requirements.txt tox.ini