diff --git a/Makefile b/Makefile index d3e25d65c..c81bdc7c7 100644 --- a/Makefile +++ b/Makefile @@ -85,7 +85,7 @@ table-check: .PHONY: schema-check schema-check: - cd tools && ./schema_check.sh + $(TOOLS_DIR)/schema_check.sh # Run all checks in order of speed / likely failure. .PHONY: check diff --git a/tools/schema_check.sh b/internal/tools/schema_check.sh similarity index 90% rename from tools/schema_check.sh rename to internal/tools/schema_check.sh index 0588b9b63..73194d86d 100755 --- a/tools/schema_check.sh +++ b/internal/tools/schema_check.sh @@ -11,11 +11,11 @@ BUILD_TOOL_SCHEMAS_VERSION=0.11.0 # List of vesions that do not require or have a schema. declare -a skip_versions=("1.0.0" "1.0.1" "1.1.0" "1.2.0" "1.3.0" "1.6.0") -schemas_dir="../schemas" -current_dir=$PWD +root_dir=$PWD +schemas_dir=$root_dir/schemas # Find all version sections in CHANGELOG that start with a number in 1..9 range. -grep -o -e '## v[1-9].*\s' ../CHANGELOG.md | grep -o '[1-9].*' | while read ver; do +grep -o -e '## v[1-9].*\s' $root_dir/CHANGELOG.md | grep -o '[1-9].*' | while read ver; do if [[ " ${skip_versions[*]} " == *" $ver "* ]]; then # Skip this version, it does not need a schema file. continue @@ -52,7 +52,7 @@ for file in $schemas_dir/*; do exit 2 fi - docker run -v $current_dir/../schemas:/schemas \ + docker run -v $schemas_dir:/schemas \ otel/build-tool-schemas:$BUILD_TOOL_SCHEMAS_VERSION --file /schemas/$ver --version=$ver echo "OK"