summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAntoine GIRARD <sapk@users.noreply.github.com>2017-05-02 15:35:59 +0200
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2017-05-02 15:35:59 +0200
commit3edb0c58943c003ed3f209b2197d1f43484a3432 (patch)
treee5849cead5053ab505a2c5dc1342111c6bcf0816 /Makefile
parentbb5f694fc57c3ade9c13e841b9a237f4e192da22 (diff)
downloadgitea-3edb0c58943c003ed3f209b2197d1f43484a3432.tar.gz
gitea-3edb0c58943c003ed3f209b2197d1f43484a3432.zip
Generate swagger json (#1402)
- Generate swagger.json into public/ - Add swagger-ui auto-installation - Add footer link to local swagger-ui - Add /swagger url for using app url. - Fix Swagger-UI version via git tag
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 11 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 2a6c42430c..275e961954 100644
--- a/Makefile
+++ b/Makefile
@@ -54,6 +54,9 @@ generate:
@hash go-bindata > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go get -u github.com/jteeuwen/go-bindata/...; \
fi
+ @hash swagger > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
+ go get -u github.com/go-swagger/go-swagger/cmd/swagger; \
+ fi
go generate $(PACKAGES)
.PHONY: errcheck
@@ -184,5 +187,13 @@ stylesheets: public/css/index.css
public/css/index.css: $(STYLESHEETS)
lessc $< $@
+.PHONY: swagger-ui
+swagger-ui:
+ rm -Rf public/assets/swagger-ui
+ git clone --depth=10 -b v3.0.7 --single-branch https://github.com/swagger-api/swagger-ui.git /tmp/swagger-ui
+ mv /tmp/swagger-ui/dist public/assets/swagger-ui
+ rm -Rf /tmp/swagger-ui
+ sed -i "s;http://petstore.swagger.io/v2/swagger.json;../../swagger.v1.json;g" public/assets/swagger-ui/index.html
+
.PHONY: assets
assets: javascripts stylesheets