This repository has been archived by the owner on Mar 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTaskfile.yml
132 lines (113 loc) · 4.42 KB
/
Taskfile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
version: '3'
tasks:
default:
cmds:
- go env
- git version
- docker version
check:
desc: Check befor submitting the code
cmds:
- task: lint
- task: secure
- task: test
- task: coverage
- echo "Both done"
build:
desc: Build the go binary.
cmds:
- GOVERSION=`go version` goreleaser --snapshot --skip-publish --rm-dist
wire:
desc: Code generated by Wire
cmds:
- wire ./cmd/...
- wire ./internal/...
lint:
desc: Run golangci-lint check
cmds:
- golangci-lint run ./... --timeout=5m
secure:
desc: Run Gosec Security Scanner
cmds:
- gosec ./...
proto:
desc: Generate proto.pb.go
cmds:
- go mod vendor
- buf lint --config buf.yaml
- go run github.com/tsundata/assistant/cmd/cli clear
- buf generate
- protoc-go-inject-tag -input=./api/pb/middle.pb.go
- protoc-go-inject-tag -input=./api/pb/todo.pb.go
- protoc-go-inject-tag -input=./api/pb/user.pb.go
- protoc-go-inject-tag -input=./api/pb/message.pb.go
- protoc-go-inject-tag -input=./api/pb/middle.pb.go
- protoc-go-inject-tag -input=./api/pb/okr.pb.go
- protoc-go-inject-tag -input=./api/pb/finance.pb.go
- protoc-go-inject-tag -input=./api/pb/todo.pb.go
- protoc-go-inject-tag -input=./api/pb/chatbot.pb.go
- protoc-go-inject-tag -input=./api/pb/id.pb.go
- git add api/pb/*.pb.go
release:
desc: Push github release
cmds:
- goreleaser release --snapshot --rm-dist
docker:
desc: Docker-compose run
cmds:
- docker-compose -f deployments/docker-compose/docker-compose.yml up --build -d
changelog:
desc: Generate changelog
cmds:
- git-chglog -o CHANGELOG.md
gentest:
desc: Generate test cases
cmds:
- gotests -w -all internal/{{.CLI_ARGS}}
cli:
desc: Run cli
cmds:
- go run github.com/tsundata/assistant/cmd/cli {{.CLI_ARGS}}
cve:
desc: Vulnerability Scanner
cmds:
- trivy fs ./
test:
desc: Go test
cmds:
- go test -cover -coverprofile=./coverage.out -timeout=10m -short github.com/tsundata/assistant/internal/...
coverage:
desc: Go coverage
cmds:
- go tool cover -func ./coverage.out
mock:
desc: Generate mock files
cmds:
- mockgen -package=mock -source=./api/pb/id_grpc.pb.go -destination=./mock/id_client.go
- mockgen -package=mock -source=./api/pb/message_grpc.pb.go -destination=./mock/message_client.go
- mockgen -package=mock -source=./api/pb/middle_grpc.pb.go -destination=./mock/middle_client.go
- mockgen -package=mock -source=./api/pb/todo_grpc.pb.go -destination=./mock/todo_client.go
- mockgen -package=mock -source=./api/pb/user_grpc.pb.go -destination=./mock/user_client.go
- mockgen -package=mock -source=./api/pb/chatbot_grpc.pb.go -destination=./mock/chatbot_client.go
- mockgen -package=mock -source=./api/pb/okr_grpc.pb.go -destination=./mock/okr_client.go
- mockgen -package=mock -source=./api/pb/storage_grpc.pb.go -destination=./mock/storage_client.go
- mockgen -package=mock -source=./api/pb/finance_grpc.pb.go -destination=./mock/finance_client.go
- mockgen -package=mock -source=./internal/app/id/repository/id.go -destination=./mock/id_repository.go
- mockgen -package=mock -source=./internal/app/chatbot/bot/todo/repository/todo.go -destination=./mock/todo_repository.go
- mockgen -package=mock -source=./internal/app/message/repository/message.go -destination=./mock/message_repository.go
- mockgen -package=mock -source=./internal/app/middle/repository/middle.go -destination=./mock/middle_repository.go
- mockgen -package=mock -source=./internal/app/user/repository/user.go -destination=./mock/user_repository.go
- mockgen -package=mock -source=./internal/app/chatbot/bot/okr/repository/okr.go -destination=./mock/okr_repository.go
- mockgen -package=mock -source=./internal/app/chatbot/repository/chatbot.go -destination=./mock/chatbot_repository.go
swag:
desc: Generate Swagger docs
cmds:
- swag init --dir ./cmd/gateway --parseDependency --parseDepth 2
migrate:
desc: Database migration
cmds:
- go run github.com/tsundata/assistant/cmd/cli migrate
fmt:
desc: fmt
cmds:
- gofmt -w internal/