-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
308 lines (275 loc) Β· 8.01 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# https://taskfile.dev
version: "3"
output: prefixed
vars:
Name: yomo
ExeName: yomo{{exeExt}}
ExeDir: yomo
ReleaseDir: release
Version:
sh: git describe --always --tags --dirty
Date:
sh: git show -s --format=%cs {{.Commit}}
Commit:
sh: git rev-parse --short HEAD
Module:
sh: go list
tasks:
default:
cmds:
- task -l
silent: true
build:
desc: build yomo cli tools
cmds:
- echo "{{.Name}} building..."
- go build -v -tags "{{.TAGS}}" -o {{.ExeDir}}/{{.ExeName}} -ldflags "-s -w -X {{.Module}}/cmd.Version={{.Version}} -X {{.Module}}/cmd.Date={{.Date}}" {{.ExeDir}}/main.go
- echo "{{.Name}} built."
generates:
- "{{.ExeDir}}/{{.ExeName}}"
sources:
- "**/*.go"
method: none
silent: true
install:
desc: install yomo cli tools
deps: []
dir: yomo
cmds:
- echo "{{.Name}} install..."
- go install -ldflags "-s -w -X {{.Module}}/cmd.Version={{.Version}} -X {{.Module}}/cmd.Date={{.Date}}"
- echo "{{.Name}} {{.Version}}({{.Date}}) is installed."
silent: true
release:
desc: release yomo cli tools
cmds:
- echo "{{.Name}} release..."
- GOOS=darwin GOARCH=amd64 go build -ldflags "-w -s -X {{.Module}}/cmd.Version={{.Version}} -X {{.Module}}/cmd.Date={{.Date}}" -o {{.ReleaseDir}}/{{.Name}}_{{.Version}}_mac yomo/main.go
- GOOS=linux GOARCH=amd64 go build -ldflags "-w -s -X {{.Module}}/cmd.Version={{.Version}} -X {{.Module}}/cmd.Date={{.Date}}" -o {{.ReleaseDir}}/{{.Name}}_{{.Version}}_linux yomo/main.go
- GOOS=linux GOARCH=arm64 go build -ldflags "-w -s -X {{.Module}}/cmd.Version={{.Version}} -X {{.Module}}/cmd.Date={{.Date}}" -o {{.ReleaseDir}}/{{.Name}}_{{.Version}}_arm yomo/main.go
- GOOS=windows GOARCH=amd64 go build -ldflags "-w -s -X {{.Module}}/cmd.Version={{.Version}} -X {{.Module}}/cmd.Date={{.Date}}" -o {{.ReleaseDir}}/{{.Name}}_{{.Version}}_windows.exe yomo/main.go
- echo "{{.Name}} {{.Version}} is released."
silent: true
run:
desc: run yomo cli
deps: [build]
cmds:
- "{{.ExeDir}}/{{.ExeName}}"
silent: false
example:
desc: example
deps:
[
example-zipper,
example-zipper2,
example-source,
example-stream-fn,
example-stream-fn-db,
]
cmds:
- echo "example"
example-yomo-dev:
desc: "run stream function via yomo-dev"
deps: [build]
cmds:
- "{{.ExeDir}}/{{.ExeName}} dev -m example/go.mod example/stream-fn/app.go"
silent: false
example-zipper:
desc: "run zipper"
deps: [build]
cmds:
- "{{.ExeDir}}/{{.ExeName}} serve -c example/zipper/workflow.yaml"
silent: false
env:
YOMO_LOG_LEVEL: error
YOMO_AUTH: token:1234
example-zipper2:
desc: "run zipper2"
deps: [build]
cmds:
- "{{.ExeDir}}/{{.ExeName}} serve -c example/zipper/workflow2.yaml"
silent: false
env:
YOMO_LOG_LEVEL: error
YOMO_AUTH: token:1234
example-source:
desc: run source application
deps: [example-source-build]
dir: "example/source"
cmds:
- "./source{{exeExt}}"
silent: false
env:
YOMO_CREDENTIAL: token:1234
example-source-build:
desc: build source application
dir: "example/source"
cmds:
- echo "source building..."
- "go build -o source{{exeExt}} main.go"
- echo "source built."
silent: false
example-stream-fn:
desc: "run stream-fn application"
deps: [build]
dir: "example/stream-fn"
cmds:
- "../../{{.ExeDir}}/{{.ExeName}} run app.go"
silent: false
example-stream-fn-db:
desc: run output stream-fn-db
deps: [build]
dir: "example/stream-fn-db"
cmds:
- "../../{{.ExeDir}}/{{.ExeName}} run app.go"
silent: false
version:
desc: "print version"
cmds:
- echo "Version {{.Version}}({{.Date}})"
silent: true
clean:
desc: "cli clean"
cmds:
- echo 'cli cleaning...'
- rm -rf example/source/source{{exeExt}}
- rm -rf example/stream-fn/stream-fn*
- rm -rf example/stream-fn/sl.*
- rm -rf example/stream-fn-db/stream-fn-db{{exeExt}}
- rm -rf example/stream-fn-db/sl.*
- rm -rf example/mesh/source/source{{exeExt}}
- rm -rf example/mesh/stream-fn/stream-fn*
- rm -rf example/mesh/stream-fn-db/stream-fn-db{{exeExt}}
- rm -rf cmd/yomo/yomo{{exeExt}}
- rm -rf release
- echo 'cli clean.'
silent: true
example-mesh-us:
desc: example-mesh-us
deps:
[
example-mesh-zipper-sender-us,
example-mesh-zipper-receiver-us,
example-mesh-stream-fn-us,
example-mesh-stream-fn-db-us,
example-mesh-source-us,
]
cmds:
- echo "example-mesh-us"
example-mesh-eu:
desc: example-mesh-eu
deps:
[
example-mesh-zipper-sender-eu,
example-mesh-zipper-receiver-eu,
example-mesh-stream-fn-eu,
example-mesh-stream-fn-db-eu,
example-mesh-source-eu,
]
cmds:
- echo "example-mesh-eu"
example-mesh-zipper-sender-us:
desc: "run zipper-sender-us"
deps: [build]
cmds:
- "{{.ExeDir}}/{{.ExeName}} serve -c example/mesh/us/sender.yaml -m https://mesh-config.yomo.run/api/configs"
# - "{{.ExeDir}}/{{.ExeName}} serve -c example/mesh/us/sender.yaml "
silent: false
example-mesh-zipper-receiver-us:
desc: "run zipper-receiver-us"
deps: [build]
cmds:
- "{{.ExeDir}}/{{.ExeName}} serve -c example/mesh/us/receiver.yaml"
silent: false
example-mesh-zipper-sender-eu:
desc: "run zipper-sender-eu"
deps: [build]
cmds:
- "{{.ExeDir}}/{{.ExeName}} serve -c example/mesh/eu/sender.yaml -m https://mesh-config.yomo.run/api/configs"
silent: false
example-mesh-zipper-receiver-eu:
desc: "run zipper-receiver-eu"
deps: [build]
cmds:
- "{{.ExeDir}}/{{.ExeName}} serve -c example/mesh/eu/receiver.yaml"
silent: false
example-mesh-source-us:
desc: run source application
deps: [example-mesh-source-build]
dir: "example/mesh/source"
cmds:
- "./source{{exeExt}}"
env:
PORT: 9000
REGION: "π US π"
silent: false
example-mesh-source-eu:
desc: run source application
deps: [example-mesh-source-build]
dir: "example/mesh/source"
cmds:
- "./source{{exeExt}}"
env:
PORT: 9800
REGION: "π EU π"
silent: false
example-mesh-source-build:
desc: build source application
dir: "example/mesh/source"
cmds:
- echo "source building..."
- "go build -o source{{exeExt}} main.go"
- echo "source built."
silent: false
example-mesh-stream-fn-us:
desc: run stream function
deps: [example-mesh-stream-fn-build]
dir: "example/mesh/stream-fn"
cmds:
- "cp ./stream-fn{{exeExt}} ./stream-fn-us{{exeExt}}"
- "./stream-fn-us{{exeExt}}"
env:
PORT: 9000
REGION: "π US π"
silent: false
example-mesh-stream-fn-eu:
desc: run stream function
deps: [example-mesh-stream-fn-build]
dir: "example/mesh/stream-fn"
cmds:
- "cp ./stream-fn{{exeExt}} ./stream-fn-eu{{exeExt}}"
- "./stream-fn-eu{{exeExt}}"
env:
PORT: 9800
REGION: "π EU π"
silent: false
example-mesh-stream-fn-build:
desc: build stream function
dir: "example/mesh/stream-fn"
cmds:
- "go build -o stream-fn{{exeExt}} app.go"
silent: false
example-mesh-stream-fn-db-us:
desc: run output stream-fn-db
deps: [example-mesh-stream-fn-db-build]
dir: "example/mesh/stream-fn-db"
cmds:
- "./stream-fn-db{{exeExt}}"
env:
PORT: 9001
silent: false
example-mesh-stream-fn-db-eu:
desc: run output stream-fn-db
deps: [example-mesh-stream-fn-db-build]
dir: "example/mesh/stream-fn-db"
cmds:
- "./stream-fn-db{{exeExt}}"
env:
PORT: 9801
silent: false
example-mesh-stream-fn-db-build:
desc: build output stream-fn-db
dir: "example/mesh/stream-fn-db"
cmds:
- "go build -o stream-fn-db{{exeExt}} app.go"
silent: false