Open and import as gradle project
gradle generateSchema
docker-compose up -d
Waiting all ready
docker run --rm --name schema-registry-gitops -v ./src/main/avdl:/avdl \
domnikl/schema-registry-gitops:1.9.0 plan --registry http://host.docker.internal:8081 \
/avdl/com/databius/contractbius/.state.yml
docker run --rm --name schema-registry-gitops -v ./src/main/avdl:/avdl \
domnikl/schema-registry-gitops:1.9.0 apply --registry http://host.docker.internal:8081 \
/avdl/com/databius/contractbius/.state.yml
Extract the schema and subjects declarations from the contract and load into .state.yaml
Requires: yq
yq e '.schema | .registry[].subjects.schema = (. | .specification) | select(.type == "avro").registry | .[].subjects as $item ireduce ([]; . += $item) | {"subjects": .}' \
./src/main/contract/com/databius/contractbius/datacontract.yaml > ./src/main/contract/com/databius/contractbius/.state.yaml
Register to schema registry
docker run --rm --name schema-registry-gitops -v ./src/main/contract:/contract \
domnikl/schema-registry-gitops:1.9.0 apply --registry http://host.docker.internal:8081 \
/contract/com/databius/contractbius/.state.yaml
docker-compose down