-
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.
- Loading branch information
1 parent
57f2440
commit d3c7e64
Showing
2 changed files
with
96 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# More info on config here: https://golangci-lint.run/usage/configuration/#config-file | ||
run: | ||
concurrency: 8 | ||
timeout: 10m | ||
issues-exit-code: 1 | ||
tests: true | ||
skip-dirs: | ||
- bin | ||
- vendor | ||
- var | ||
- tmp | ||
- .cache | ||
skip-files: | ||
- \.pb\.go$ | ||
- \.pb\.gw\.go$ | ||
|
||
output: | ||
format: colored-line-number | ||
print-issued-lines: true | ||
print-linter-name: true | ||
|
||
linters-settings: | ||
govet: | ||
check-shadowing: true | ||
dupl: | ||
threshold: 100 | ||
goconst: | ||
min-len: 2 | ||
min-occurrences: 2 | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- errcheck | ||
- goconst | ||
- goimports | ||
- gosec | ||
- govet | ||
- ineffassign | ||
- megacheck | ||
- revive | ||
- typecheck | ||
- unused | ||
|
||
issues: | ||
exclude-use-default: false | ||
exclude: | ||
# _ instead of err checks | ||
- G104 | ||
- exported func .* returns unexported type .*, which can be annoying to use | ||
- should have a package comment | ||
- don't use an underscore in package name |
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,44 @@ | ||
LOCAL_BIN:=$(CURDIR)/bin | ||
|
||
install-golangci-lint: | ||
GOBIN=$(LOCAL_BIN) go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
|
||
lint: | ||
GOBIN=$(LOCAL_BIN) golangci-lint run ./... --config .golangci.pipeline.yaml | ||
|
||
install-deps: | ||
GOBIN=$(LOCAL_BIN) go install google.golang.org/protobuf/cmd/[email protected] | ||
GOBIN=$(LOCAL_BIN) go install -mod=mod google.golang.org/grpc/cmd/[email protected] | ||
|
||
get-deps: | ||
go get -u google.golang.org/protobuf/cmd/protoc-gen-go | ||
go get -u google.golang.org/grpc/cmd/protoc-gen-go-grpc | ||
|
||
|
||
generate: | ||
make generate-chat-api | ||
|
||
generate-chat-api: | ||
mkdir -p pkg/chat_v1 | ||
protoc --proto_path api/chat_v1 \ | ||
--go_out=pkg/chat_v1 --go_opt=paths=source_relative \ | ||
--plugin=protoc-gen-go=bin/protoc-gen-go \ | ||
--go-grpc_out=pkg/chat_v1 --go-grpc_opt=paths=source_relative \ | ||
--plugin=protoc-gen-go-grpc=bin/protoc-gen-go-grpc \ | ||
api/chat_v1/chat_api.proto | ||
|
||
build: | ||
GOOS=linux GOARCH=amd64 go build -o service_linux cmd/grpc_server/main.go | ||
|
||
copy-to-server: | ||
scp service_linux [email protected]: | ||
|
||
docker-build-and-push: | ||
docker buildx build --no-cache --platform linux/amd64 -t cr.selcloud.ru/andy/test-server:v0.0.1 . | ||
docker login -u token -p CRgAAAAAoQE7iwALBafCWa6tUmvJiqqLwWk4Z6PY cr.selcloud.ru/andy | ||
docker push cr.selcloud.ru/andy/test-server:v0.0.1 | ||
|
||
# docker-build-and-push: | ||
# docker buildx build --no-cache --platform linux/amd64 -t <REGESTRY>/test-server:v0.0.1 . | ||
# docker login -u <USERNAME> -p <PASSWORD> <REGESTRY> | ||
# docker push <REGESTRY>/test-server:v0.0.1 |