-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
97 lines (82 loc) · 2.49 KB
/
Taskfile.yml
File metadata and controls
97 lines (82 loc) · 2.49 KB
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
# go install github.com/go-task/task/v3/cmd/task@latest
version: '3'
vars:
TOOLS_DIR: 'third_party/build-tools'
MODULE_NAME: { sh: go list -m | head -n 1 }
LOCAL_OS: { sh: go env GOOS }
LOCAL_ARCH: { sh: go env GOARCH }
env:
BUILD_ROOT:
sh: 'printf "%s" "${LOCAL_BUILD_ROOT:-}"'
tasks:
check:
desc: Env check
cmds:
- cmd: bash {{.TOOLS_DIR}}/scripts/tools_check.sh
silent: true
format:
desc: Format *go code
cmds:
- cmd: bash {{.TOOLS_DIR}}/scripts/format.sh all
silent: true
format-app:
desc: Format {app}/*go code
cmds:
- cmd: bash {{.TOOLS_DIR}}/scripts/format.sh {{.CLI_ARGS}}
silent: true
lint:
desc: Lint all code
cmds:
- cmd: bash {{.TOOLS_DIR}}/scripts/lint.sh
silent: true
conf:
desc: Gen {app}/internal/conf/*.proto
cmds:
- cmd: bash {{.TOOLS_DIR}}/scripts/build_config.sh {{.CLI_ARGS}}
silent: true
wire:
desc: wire gen selected {app}
cmds:
- cmd: bash {{.TOOLS_DIR}}/scripts/wire_gen.sh {{.CLI_ARGS}}
silent: true
- cmd: task format-app -- {{.CLI_ARGS}}
silent: true
wire-all:
desc: wire gen all app
cmds:
- cmd: bash {{.TOOLS_DIR}}/scripts/wire_gen.sh all
silent: true
- cmd: task format
silent: true
build:
desc: build app for the native platform
cmds:
- cmd: bash {{.TOOLS_DIR}}/scripts/build_app.sh {{.LOCAL_OS}} {{.LOCAL_ARCH}} '' {{.CLI_ARGS}}
silent: true
build-linux-amd64:
desc: build app for the linux-amd64
cmds:
- cmd: bash {{.TOOLS_DIR}}/scripts/build_app.sh linux amd64 '' {{.CLI_ARGS}}
silent: true
build-linux-arm64:
desc: build app for the linux-arm64
cmds:
- cmd: bash {{.TOOLS_DIR}}/scripts/build_app.sh linux arm64 '' {{.CLI_ARGS}}
silent: true
deploy:
desc: build app to the server
cmds:
- cmd: task build-linux-amd64 -- {{.CLI_ARGS}}
silent: true
- cmd: AUTO_RESTART=true {{.TOOLS_DIR}}/scripts/deploy_app.sh linux amd64 {{.CLI_ARGS}}
silent: true
newapp:
desc: create new app with app_layout
cmds:
- cmd: bash {{.TOOLS_DIR}}/scripts/newapp.sh {{ .MODULE_NAME }} {{.CLI_ARGS}}
silent: true
image-linux-amd64:
desc: build app image for the linux-amd64, e.g. task image-linux-amd64 -- app/probe_center v1.0.0 [-p/--push]
cmds:
- cmd: echo {{.TOOLS_DIR}}/scripts/build_app_image.sh {{.CLI_ARGS}} --os linux --arch amd64
silent: true