summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAntoine GIRARD <sapk@users.noreply.github.com>2018-04-20 11:13:50 +0200
committerBo-Yi Wu <appleboy.tw@gmail.com>2018-04-20 17:13:50 +0800
commit3506717e9c1cba08576e6dc861ea37e6417091e5 (patch)
tree1b67f1a5a5aa38d69203e9814c88f6eda6a52af2 /Makefile
parentcf8c2e5951bca4383b7259388f6dd2e8fa07fea8 (diff)
downloadgitea-3506717e9c1cba08576e6dc861ea37e6417091e5.tar.gz
gitea-3506717e9c1cba08576e6dc861ea37e6417091e5.zip
Add swagger check (#3811)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 4f4802a024..f79df2b4b3 100644
--- a/Makefile
+++ b/Makefile
@@ -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