generated from Yandex-Practicum/go-musthave-metrics-tpl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from ex0rcist/iter18
Инкременты №16-18
- Loading branch information
Showing
82 changed files
with
7,041 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,5 @@ vendor/ | |
# IDEs directories | ||
.idea | ||
.vscode | ||
|
||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
API_DOCS = docs/api | ||
|
||
AGENT_VERSION ?= 0.1.0 | ||
SERVER_VERSION ?= 0.1.0 | ||
|
||
BUILD_DATE ?= $(shell date +%F\ %H:%M:%S) | ||
BUILD_COMMIT ?= $(shell git rev-parse --short HEAD) | ||
|
||
build: agent server | ||
.PHONY: build | ||
|
||
agent: ## build agent | ||
go build \ | ||
-ldflags "\ | ||
-X 'main.buildVersion=$(AGENT_VERSION)' \ | ||
-X 'main.buildDate=$(BUILD_DATE)' \ | ||
-X 'main.buildCommit=$(BUILD_COMMIT)' \ | ||
" \ | ||
-o cmd/$@/$@ \ | ||
cmd/$@/*.go | ||
.PHONY: agent | ||
|
||
server: ## build server | ||
rm -rf $(API_DOCS) | ||
swag init -g ./internal/httpserver/handlers.go --output $(API_DOCS) | ||
|
||
go build \ | ||
-ldflags "\ | ||
-X 'main.buildVersion=$(SERVER_VERSION)' \ | ||
-X 'main.buildDate=$(BUILD_DATE)' \ | ||
-X 'main.buildCommit=$(BUILD_COMMIT)' \ | ||
" \ | ||
-o cmd/$@/$@ \ | ||
cmd/$@/*.go | ||
.PHONY: server | ||
|
||
clean: ## remove build artifacts | ||
rm -rf cmd/agent/agent cmd/server/server cmd/staticlint/staticlint | ||
.PHONY: clean | ||
|
||
unit-tests: ## run unit tests | ||
@go test -v -race ./... -coverprofile=coverage.out.tmp -covermode atomic | ||
@cat coverage.out.tmp | grep -v -E "(_mock|.pb).go" > coverage.out | ||
@go tool cover -html=coverage.out -o coverage.html | ||
@go tool cover -func=coverage.out | ||
.PHONY: unit-tests | ||
|
||
godoc: ### show public packages documentation using godoc | ||
@echo "Project documentation is available at:" | ||
@echo "http://127.0.0.1:3000/pkg/github.com/ex0rcist/metflix/pkg/\n" | ||
@godoc -http=:3000 -play | ||
.PHONY: godoc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.