Skip to content

Commit

Permalink
replaced swagger-ui with static version to reduce memory footprint
Browse files Browse the repository at this point in the history
  • Loading branch information
0xERR0R committed Jan 8, 2021
1 parent f67fd16 commit 2f756b6
Show file tree
Hide file tree
Showing 8 changed files with 8,562 additions and 114 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 1,5 @@
bin/
.idea
.github
testdata/
testdata/
node_modules/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 9,4 @@ config.yml
coverage.txt
todo.txt
!docs/config.yml
node_modules
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 1,4 @@
.PHONY: all tools clean build test lint run buildMultiArchRelease help
.PHONY: all tools clean build swagger test lint run buildMultiArchRelease help
.DEFAULT_GOAL := help

VERSION := $(shell git describe --always --tags)
Expand All @@ -16,8 16,13 @@ all: test lint build ## Build binary (with tests)
clean: ## cleans output directory
$(shell rm -rf $(BIN_OUT_DIR)/*)

build: ## Build binary
swagger:
npm install bootprint bootprint-openapi html-inline
$(shell go env GOPATH)/bin/swag init -g api/api.go
$(shell) node_modules/bootprint/bin/bootprint.js openapi docs/swagger.json /tmp/swagger/
$(shell) node_modules/html-inline/bin/cmd.js /tmp/swagger/index.html > docs/swagger.html

build: ## Build binary
go build -v -ldflags="-w -s -X blocky/cmd.version=${VERSION} -X blocky/cmd.buildTime=${BUILD_TIME}" -o $(BIN_OUT_DIR)/$(BINARY_NAME)$(BINARY_SUFFIX)

test: ## run tests
Expand Down
Loading

0 comments on commit 2f756b6

Please sign in to comment.