diff options
author | Antoine GIRARD <sapk@users.noreply.github.com> | 2018-04-20 11:13:50 +0200 |
---|---|---|
committer | Bo-Yi Wu <appleboy.tw@gmail.com> | 2018-04-20 17:13:50 +0800 |
commit | 3506717e9c1cba08576e6dc861ea37e6417091e5 (patch) | |
tree | 1b67f1a5a5aa38d69203e9814c88f6eda6a52af2 /Makefile | |
parent | cf8c2e5951bca4383b7259388f6dd2e8fa07fea8 (diff) | |
download | gitea-3506717e9c1cba08576e6dc861ea37e6417091e5.tar.gz gitea-3506717e9c1cba08576e6dc861ea37e6417091e5.zip |
Add swagger check (#3811)
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -91,6 +91,15 @@ generate-swagger: fi swagger generate spec -o ./public/swagger.v1.json +.PHONY: swagger-check +swagger-check: generate-swagger + @diff=$$(git diff public/swagger.v1.json); \ + if [ -n "$$diff" ]; then \ + echo "Please run 'make generate-swagger' and commit the result:"; \ + echo "$${diff}"; \ + exit 1; \ + fi; + .PHONY: errcheck errcheck: @hash errcheck > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ @@ -288,7 +297,7 @@ generate-stylesheets: .PHONY: swagger-ui swagger-ui: rm -Rf public/vendor/assets/swagger-ui - git clone --depth=10 -b v3.3.2 --single-branch https://github.com/swagger-api/swagger-ui.git $(TMPDIR)/swagger-ui + git clone --depth=10 -b v3.13.4 --single-branch https://github.com/swagger-api/swagger-ui.git $(TMPDIR)/swagger-ui mv $(TMPDIR)/swagger-ui/dist public/vendor/assets/swagger-ui rm -Rf $(TMPDIR)/swagger-ui $(SED_INPLACE) "s;http://petstore.swagger.io/v2/swagger.json;../../../swagger.v1.json;g" public/vendor/assets/swagger-ui/index.html |