-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
51 lines (44 loc) · 2.29 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
version: '3'
tasks:
test:
env:
LOG_LEVEL: error
ENV: test
SELECTOR: memory
REGISTRY: memory
TRANSPORT: memory
desc: "Runs unit tests and displays code coverage"
cmds:
- go test -coverprofile=profile.cov -v ./... --tags "json1"
- go tool cover -func=profile.cov | grep total | awk '{print $3}' | tee coverage.log
- rm -fr coverage.log profile.cov
coverage:
desc: "Generate and opens HTML test coverage"
cmds:
- LOG_LEVEL=error ENV=test SELECTOR=static TRANSPORT=memory BROKER=memory go test -coverprofile=profile.cov -v ./... --tags "json1"
- go tool cover -html=profile.cov
- rm -fr coverage.log profile.cov
proto:
desc: "Generates protobuf basing on proto files"
cmds:
- protoc -I $GOPATH/src -I $GOPATH/src/github.com/googleapis/googleapis -I $GOPATH/src/github.com/grpc-ecosystem/grpc-gateway --go_out=paths=source_relative:../../../ --go-grpc_out=paths=source_relative:../../../ $GOPATH/src/github.com/sumlookup/cowboys/pb/*.proto
protogw:
desc: "Generates protobuf grpc-gateway from yaml config files v2"
cmds:
- protoc -I $GOPATH/src -I $GOPATH/include -I $GOPATH/src/github.com/googleapis/googleapis -I $GOPATH/src/github.com/grpc-ecosystem/grpc-gateway --grpc-gateway_out ../../../ --grpc-gateway_opt paths=source_relative --grpc-gateway_opt logtostderr=true --grpc-gateway_opt generate_unbound_methods=true --grpc-gateway_opt standalone=false --grpc-gateway_opt grpc_api_configuration=$GOPATH/src/github.com/sumlookup/cowboys/pb/cowboys_api.yaml $GOPATH/src/github.com/sumlookup/cowboys/pb/*.proto
compose:
desc: "Run docker compose"
cmds:
- docker compose -p castai -f ./docker-compose.yaml up cockroach -d
- docker compose -p castai -f ./docker-compose.yaml up initcockroach -d
- docker compose -p castai -f ./docker-compose.yaml up
deploy-crdb:
desc: "install cockroachdb single cluster to k8s (minikube)"
cmds:
- helm repo add cockroachdb https://charts.cockroachdb.com/
- helm install cowboysdb --values ./helpers/crdb/crdb_values_override.yaml cockroachdb/cockroachdb
deploy-service:
desc: "Deploy application to k8s cluster (minikube) using helm"
cmds:
- kubectl create namespace dev
- helm install cowboys chart/ -n dev