-
Notifications
You must be signed in to change notification settings - Fork 1
/
Taskfile.yaml
90 lines (81 loc) · 2.32 KB
/
Taskfile.yaml
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
version: "3"
dotenv: [".env"]
tasks:
docker-build:
vars:
BIN_DIR: "{{.USER_WORKING_DIR}}/_bin"
cmds:
- >-
docker buildx build
--no-cache
--platform=linux/amd64
--file={{.USER_WORKING_DIR}}/Dockerfile
--build-arg="BIN_NAME=$GRPC_PROXY_BIN_NAME"
--tag=grpc-proxy:v{{.VERSION}} .
docker-build-bin:
vars:
BIN_DIR: "{{.USER_WORKING_DIR}}/_bin"
cmds:
- >-
docker buildx build
--no-cache
--platform=linux/amd64
--file={{.USER_WORKING_DIR}}/Dockerfile.build
--build-arg="BIN_NAME=$GRPC_PROXY_BIN_NAME"
--output={{.BIN_DIR}}/
--target=releaser {{.USER_WORKING_DIR}}
docker-build-plugin:
requires:
vars:
- PLUGIN_GO_FILE
vars:
BIN_DIR: "{{.USER_WORKING_DIR}}/_bin"
PLUGIN_SO_FILE: "{{trimSuffix (ext .PLUGIN_GO_FILE) .PLUGIN_GO_FILE}}.so"
cmds:
- echo 'Building plugin for {{.USER_WORKING_DIR}}/_plugins/{{.PLUGIN_GO_FILE}} > {{.BIN_DIR}}/{{.PLUGIN_SO_FILE}}'
- rm -vf {{.BIN_DIR}}/{{.PLUGIN_SO_FILE}} {{.BIN_DIR}}/go.{mod,sum} {{.BIN_DIR}}/*.go
- >-
docker buildx build
--no-cache
--platform=linux/amd64
--file={{.USER_WORKING_DIR}}/Dockerfile.build_plugin
--build-arg="PLUGIN_GO_FILE={{.PLUGIN_GO_FILE}}"
--build-arg="PLUGIN_SO_FILE={{.PLUGIN_SO_FILE}}"
--output={{.BIN_DIR}}/
--target=releaser {{.USER_WORKING_DIR}}
- rm -vf {{.BIN_DIR}}/go.{mod,sum} {{.BIN_DIR}}/*.go
docker-build-all-plugins:
vars:
PLUGINS:
sh: ls -1 {{.USER_WORKING_DIR}}/_plugins/
cmds:
- for: { var: PLUGINS, as: PLUGIN_GO_FILE }
task: docker-build-plugin
vars:
PLUGIN_GO_FILE: "{{.PLUGIN_GO_FILE}}"
docker-build-plugins:
vars:
PLUGINS:
sh: cat {{.USER_WORKING_DIR}}/_plugins_pkg/{{.PKG}}.pkg
cmds:
- for: { var: PLUGINS, as: PLUGIN }
task: docker-build-plugin
vars:
PLUGIN_GO_FILE: "{{.PLUGIN}}.go"
go-fmt:
cmds:
- gofumpt -l -w .
local-build:
dotenv: [".env"]
cmds:
- task: go-fmt
- >-
go build
-o bin/$GRPC_PROXY_BIN_NAME
{{if .VERBOSE}}-v -a{{end}}
main.go
local-dist:
cmds:
- task: build
vars:
VERBOSE: true