Skip to content

Commit bb4e2dc

Browse files
committed
chore: Makefile full schema versioning
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
1 parent 20bcb78 commit bb4e2dc

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
PHONY: .docker-build .build .run .mockgen
22
PREFIX=/usr/local
3-
PUBLIC_JSON_SCHEMA_DIR=docs/schema/v0/
3+
JSON_SCHEMA_VERSION=v0.2.3
4+
PUBLIC_JSON_SCHEMA_DIR=docs/schema/$(JSON_SCHEMA_VERSION)/
45
ALL_GO_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort)
56

67
FLAGD_DEV_NAMESPACE ?= flagd-dev
@@ -116,7 +117,7 @@ markdownlint-fix:
116117

117118
.PHONY: pull-schemas-submodule
118119
pull-schemas-submodule:
119-
git submodule update schemas
120+
cd schemas/ && git checkout json/json-schema-$(JSON_SCHEMA_VERSION)
120121

121122
.PHONY: generate-proto-docs
122123
generate-proto-docs: pull-schemas-submodule
@@ -125,11 +126,12 @@ generate-proto-docs: pull-schemas-submodule
125126
&& sed '/^## Table of Contents/,/#top/d' ${PWD}/$(DOCS_DIR)/reference/specifications/protos-with-toc.md >> ${PWD}/$(DOCS_DIR)/reference/specifications/protos.md \
126127
&& rm -f ${PWD}/$(DOCS_DIR)/reference/specifications/protos-with-toc.md
127128

128-
# Update the schema at flagd.dev
129-
# PUBLIC_JSON_SCHEMA_DIR above controls the dir (and therefore major version)
129+
# update or add the publicly served schema at https://flagd.dev/schema/${JSON_SCHEMA_VERSION}/flags.json
130+
# update JSON_SCHEMA_VERSION var at the top of this file with a the version to be updated or addeds
130131
.PHONY: update-public-schema
131132
update-public-schema: pull-schemas-submodule
132-
rm -f $(PUBLIC_JSON_SCHEMA_DIR)*.json
133+
rm -rf ./$(PUBLIC_JSON_SCHEMA_DIR) || true
134+
mkdir ./$(PUBLIC_JSON_SCHEMA_DIR)
133135
cp schemas/json/*.json $(PUBLIC_JSON_SCHEMA_DIR)
134136

135137
.PHONY: run-web-docs

0 commit comments

Comments
 (0)