-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
148 lines (128 loc) · 3.26 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# https://taskfile.dev
version: '3'
vars:
NAME: 'Baron'
tasks:
default:
cmds:
- echo "{{.NAME}}"
- task -l
silent: true
build:
desc: 'build baron CLI'
dir: ./cmd/baron
cmds:
- go build -o baron main.go
silent: true
run:
desc: 'run baron CLI'
dir: ./cmd/baron
cmds:
- go run main.go
silent: true
bindata:
desc: 'generate go-bindata'
cmds:
- go generate github.com/teamlint/baron/gengokit/template
silent: true
install:
desc: 'install baron CLI'
cmds:
- task: bindata
- go install -ldflags '-X "main.version={{.VERSION}}" -X "main.date={{.VERSION_DATE}}"' github.com/teamlint/baron/cmd/baron
vars:
VERSION:
sh: git describe --always --tags --dirty
SHA:
sh: git rev-parse --short=10 HEAD
VERSION_DATE:
sh: git show -s --format=%cI {{.HEAD_COMMIT}}
HEAD_COMMIT:
sh: git rev-parse HEAD
silent: false
version:
desc: 'print version'
cmds:
- echo 'version={{.VERSION}} date={{.VERSION_DATE}}'
vars:
VERSION:
sh: git describe --always --tags --dirty
SHA:
sh: git rev-parse --short=10 HEAD
VERSION_DATE:
sh: git show -s --format=%cI {{.HEAD_COMMIT}}
HEAD_COMMIT:
sh: git rev-parse HEAD
silent: true
gen-example:
desc: 'baron gen example service'
dir: './_example'
cmds:
- baron -v --client --svcout=./ ./api/echo/echo.proto
silent: false
gen-example-grpc:
desc: 'baron gen example.grpc service'
dir: './_example'
cmds:
- baron -v --client --svcout=./ --transport=grpc ./api/echo/echo.proto
silent: false
gen-example-nats:
desc: 'baron gen example.nats service'
dir: './_example'
cmds:
- baron -v --client --svcout=./ --transport=nats ./api/echo/echo.proto
silent: false
run-example:
desc: 'run example'
dir: ./_example/echo-service/cmd/echo
cmds:
- go run main.go -http.addr=:5050 -grpc.addr=:5040 -nats.addr=:4222
silent: false
run-example-client:
desc: 'run example'
dir: ./_example/echo-service/cmd/echo-client
cmds:
- go run main.go
silent: false
build-example:
desc: 'run example'
dir: ./_example/echo-service/cmd/echo
cmds:
- go build main.go
silent: false
start:
desc: 'baron -v --start {pkgname} {outdir}'
dir: ./_example/
cmds:
- baron -v --start start ./api/start
silent: false
gen-start:
desc: 'baron gen start service'
dir: ./_example/
cmds:
- baron -v -c --svcout=./ ./api/start/start.proto
silent: false
run-start:
desc: 'run start'
dir: ./_example/start-service/cmd/start
cmds:
- go run main.go -http.addr=:5050 -grpc.addr=:5040 -nats.addr=:4222
silent: false
run-start-client:
desc: 'run start.client'
dir: ./_example/start-service/cmd/start-client
cmds:
- go run main.go
silent: false
test:
desc: 'baron test generator'
dir: ./_example
cmds:
- rm -rf ./start/start.pb.go
- rm -rf ./start/start_grpc.pb.go
- rm -rf ./start/start.pb.baron.go
- rm -rf ./start-service
- task: install
- task: gen-start
- task: run-start
silent: false