Skip to content

Commit 51b77cf

Browse files
committed
feat: add api-client-local Makefile target
Refactor api-client into a shared _api-client-generate internal target and add api-client-local that skips the download step. This allows CI workflows to copy schemas from git and then regenerate the client without needing a live server.
1 parent 7741b78 commit 51b77cf

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ define generate_client
5858
./scripts/generate_client.sh gooddata-$(1)-client -f "/local/schemas/gooddata-$(1)-client.json"
5959
endef
6060

61-
.PHONY: api-client
62-
api-client: download
61+
.PHONY: _api-client-generate
62+
_api-client-generate:
6363
rm -f schemas/gooddata-api-client.json
6464
cat schemas/gooddata-*.json | jq -S -s 'reduce .[] as $$item ({}; . * $$item) + { tags : ( reduce .[].tags as $$item (null; . + $$item) | unique_by(.name) ) }' | sed '/\u0000/d' > "schemas/gooddata-api-client.json"
6565
$(call generate_client,api)
@@ -69,6 +69,12 @@ api-client: download
6969
sed -i.bak 's/\^\[\^\]\*\$$/^[^\\x00]*$$/g' {} + && \
7070
find gooddata-api-client/gooddata_api_client -name '*.py.bak' -delete
7171

72+
.PHONY: api-client
73+
api-client: download _api-client-generate
74+
75+
.PHONY: api-client-local
76+
api-client-local: _api-client-generate
77+
7278
.PHONY: download
7379
download:
7480
$(call download_client,afm)

0 commit comments

Comments
 (0)