2023-11-16 11:40:37 +02:00
|
|
|
SERVICENAME=sync_service
|
|
|
|
SERVICEURL=github.com/ManyakRus/$(SERVICENAME)
|
|
|
|
|
|
|
|
FILEMAIN=./cmd/$(SERVICENAME)/main.go
|
|
|
|
FILEAPP=./bin/$(SERVICENAME)
|
|
|
|
|
|
|
|
NEW_REPO=$(SERVICENAME)
|
2023-11-29 14:06:50 +02:00
|
|
|
CD_GENERATION_PROTO=cd ./api
|
2023-11-20 17:02:26 +02:00
|
|
|
GENERATION_PROTO=generation_code.sh
|
2023-11-16 11:40:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
run:
|
|
|
|
clear
|
|
|
|
go build -race -o $(FILEAPP) $(FILEMAIN)
|
|
|
|
# cd ./bin && \
|
|
|
|
./bin/$(SERVICENAME)
|
|
|
|
mod:
|
|
|
|
clear
|
|
|
|
go get -u ./...
|
|
|
|
go mod tidy -compat=1.18
|
|
|
|
go mod vendor
|
|
|
|
go fmt ./...
|
|
|
|
build:
|
|
|
|
clear
|
|
|
|
go build -race -o $(FILEAPP) $(FILEMAIN)
|
|
|
|
cd ./scripts && \
|
|
|
|
./VersionToFile.py
|
|
|
|
|
|
|
|
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 ./...
|
|
|
|
go test -coverprofile cover.out ./internal/v0/app/...
|
|
|
|
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-08 14:33:06 +02:00
|
|
|
rm ./go.mod
|
2023-11-16 11:40:37 +02:00
|
|
|
go mod init gitlab.aescorp.ru/dsp_dev/claim/sync_service
|
2023-11-20 17:02:26 +02:00
|
|
|
$(CD_GENERATION_PROTO)
|
|
|
|
$(GENERATION_PROTO)
|
2023-11-29 14:06:50 +02:00
|
|
|
go mod tidy
|
|
|
|
go mod vendor
|