diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e564da8..a35bfb0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,9 +22,9 @@ repos: entry: make fmt language: system pass_filenames: false - - id: make-version - name: Run make version - entry: make version + - id: make-vsn + name: Run make vsn + entry: make vsn language: system pass_filenames: false - id: make-compatibility diff --git a/CHANGELOG.md b/CHANGELOG.md index 3401010..c934954 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [3.0] - 2024-10-08 - Oryukdo (오륙도, 五六島) +## [3.0] - 2024-10-08 - Potanin Glacier ### Added - Version compatibility information diff --git a/Makefile b/Makefile index 9410486..32ee6a3 100755 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ SHELL=bash include help.mk -.PHONY: doc fmt version compatibility pre-commit unpre-commit pre-commit-run +.PHONY: doc fmt vsn compatibility pre-commit unpre-commit pre-commit-run # Regenerate documentation for proto files: doc: @@ -23,28 +23,12 @@ fmt: done # Run version update check -version: - @version=$$(wget -qO- "https://git.frostfs.info/TrueCloudLab/frostfs-api/raw/branch/master/version.json"); \ - if [ -z "$$version" ]; then \ - exit; \ - fi; \ - masterMilestone=$$(jq -n --argjson data "$$version" '$$data.milestone'); \ - masterPatch=$$(jq -n --argjson data "$$version" '$$data.patch'); \ - milestone=$$(jq -r '.milestone' version.json); \ - patch=$$(jq -r '.patch' version.json); \ - if [ "$$masterMilestone" -eq "$$milestone" -a "$$masterPatch" -eq "$$patch" ]; then \ - echo "⇒ You need to update the api version in the version.json file"; \ - exit 1; \ - elif [ "$$masterMilestone" -gt "$$milestone" ]; then \ - echo "⇒ The milestone cannot be decrement in the version.json file"; \ - exit 1; \ - elif [ "$$masterMilestone" -eq "$$milestone" -a "$$masterPatch" -gt "$$patch" ]; then \ - echo "⇒ The patch cannot be decrement without milestone increment in the version.json file"; \ - exit 1; \ - elif [ "$$masterMilestone" -lt "$$milestone" -a "$$patch" -ne 0 ]; then \ - echo "⇒ The patch should be 0 after milestone increment in the version.json file"; \ - exit 1; \ - fi +vsn: + @diff=$$(git diff-index master version.json); \ + if [[ -z "$$diff" ]]; then \ + echo "⇒ You need to update the api version in the version.json file"; \ + exit 1;\ + fi # Run compatibility information check compatibility: