-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTaskfile.pipe.yml
66 lines (56 loc) · 1.37 KB
/
Taskfile.pipe.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
---
# https://taskfile.dev
version: "3"
vars:
GO_LD_FLAGS: -w -s
BINARY_DIR: dist
BINARY_NAME: pipe
BINARY_APPEND_OS: true
BINARY_APPEND_ARCH: true
env:
CGO_ENABLED: 0
tasks:
clean:
desc: Cleans the output binary folder and build cache.
cmds:
- go clean
- rm -f {{ .BINARY_DIR }}
test:
desc: Tests the given application.
cmds:
- go test -v -p 1 ./...
build:
desc: Builds the application.
deps:
- task: build.platform
vars:
os: linux
arch: amd64
- task: build.platform
vars:
os: linux
arch: arm64
build.platform:
internal: true
vars:
binary_output: '{{ .BINARY_DIR }}/{{ .BINARY_NAME }}{{ if eq .BINARY_APPEND_OS true }}-{{ .os }}{{ end }}{{ if eq .BINARY_APPEND_ARCH true }}-{{ .arch }}{{ end }}'
cmds:
- GOOS={{ .os }} GOARCH={{ .arch }} go build -mod=vendor {{- if .GO_LD_FLAGS }} -ldflags="{{ .GO_LD_FLAGS }}"{{- end }} -o {{ .binary_output }}
start:
desc: Starts the given application.
interactive: true
env:
LOG_LEVEL: debug
cmds:
- go run . {{ .CLI_ARGS }}
docs:
desc: Generates the documentation for the application.
interactive: true
env:
LOG_LEVEL: trace
cmds:
- go run . MARKDOWN_DOC
help:
desc: Generates help for the application.
cmds:
- go run . --help