2023-11-15 16:59:21 +02:00
|
|
|
SERVICENAME=sync_service
|
|
|
|
SERVICEURL=github.com/ManyakRus/$(SERVICENAME)
|
|
|
|
|
|
|
|
FILEMAIN=./cmd/$(SERVICENAME)/main.go
|
|
|
|
FILEAPP=./bin/$(SERVICENAME)
|
|
|
|
|
|
|
|
NEW_REPO=$(SERVICENAME)
|
2024-02-09 14:17:57 +02:00
|
|
|
CD_GENERATION_PROTO=cd ./api
|
|
|
|
GENERATION_PROTO=generation_code.sh
|
2023-11-15 16:59:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
run:
|
|
|
|
clear
|
|
|
|
go build -race -o $(FILEAPP) $(FILEMAIN)
|
|
|
|
# cd ./bin && \
|
|
|
|
./bin/$(SERVICENAME)
|
|
|
|
mod:
|
|
|
|
clear
|
|
|
|
go get -u ./...
|
2024-06-04 17:03:27 +02:00
|
|
|
go mod tidy -compat=1.22
|
2023-11-15 16:59:21 +02:00
|
|
|
go mod vendor
|
|
|
|
go fmt ./...
|
|
|
|
build:
|
|
|
|
clear
|
2024-11-20 14:13:02 +02:00
|
|
|
go fmt ./...
|
2023-11-15 16:59:21 +02:00
|
|
|
go build -race -o $(FILEAPP) $(FILEMAIN)
|
|
|
|
lint:
|
|
|
|
clear
|
|
|
|
go fmt ./...
|
|
|
|
golangci-lint run ./internal/...
|
|
|
|
golangci-lint run ./pkg/...
|
|
|
|
gocyclo -over 10 ./internal
|
|
|
|
gocyclo -over 10 ./pkg
|
|
|
|
gocritic check ./internal/...
|
|
|
|
gocritic check ./pkg/...
|
|
|
|
staticcheck ./internal/...
|
|
|
|
staticcheck ./pkg/...
|
|
|
|
run.test:
|
|
|
|
clear
|
|
|
|
go fmt ./...
|
2024-11-20 14:11:12 +02:00
|
|
|
go test -coverprofile cover.out ./internal/...
|
2023-11-15 16:59:21 +02:00
|
|
|
go tool cover -func=cover.out
|
|
|
|
newrepo:
|
|
|
|
sed -i 's+$(SERVICEURL)+$(NEW_REPO)+g' go.mod
|
|
|
|
find -name *.go -not -path "*/vendor/*"|xargs sed -i 's+$(SERVICEURL)+$(NEW_REPO)+g'
|
|
|
|
graph:
|
|
|
|
clear
|
|
|
|
image_packages ./ docs/packages.graphml
|
|
|
|
conn:
|
|
|
|
clear
|
|
|
|
image_connections ./internal docs/connections.graphml $(SERVICENAME)
|
|
|
|
init:
|
|
|
|
clear
|
2024-02-09 14:17:57 +02:00
|
|
|
rm -f ./go.mod
|
2024-11-20 14:11:12 +02:00
|
|
|
go mod init gitlab.aescorp.ru/dsp_dev/claim/$(SERVICENAME)
|
2024-02-09 14:17:57 +02:00
|
|
|
$(CD_GENERATION_PROTO)
|
2023-11-17 15:48:58 +02:00
|
|
|
$(GENERATION_PROTO)
|
2023-11-29 13:09:53 +02:00
|
|
|
go mod tidy
|
|
|
|
go mod vendor
|