-
Notifications
You must be signed in to change notification settings - Fork 4
/
Taskfile.yml
105 lines (90 loc) · 1.8 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
# https://taskfile.dev
version: "3"
vars:
VERSION:
sh: git describe --tags --abbrev=0
COMMIT:
sh: git rev-parse --short HEAD
tasks:
build-base:
env:
CGO_ENABLE: "0"
cmds:
- cmd: >
go build -ldflags
"
-X 'main.version={{.VERSION}}'
-X 'main.commit={{.COMMIT}}'
-X 'main.embed={{.CONFIG}}'
"
-o ./builds/pando-{{.name}}
./cmd/pando-{{.name}}
build-server:
cmds:
- task: build-base
vars:
name: server
build-worker:
cmds:
- task: build-base
vars:
name: worker
build:
cmds:
- task: build-worker
- task: build-server
build-cli:
cmds:
- task: build-base
vars:
name: cli
install-cli:
deps:
- build-cli
cmds:
- cp ./builds/pando-cli ${GOPATH}/bin/pd
docker-base:
vars:
image: pando/{{.name}}
version:
sh: echo {{.VERSION}} | cut -c2-
cmds:
- cmd: docker rmi {{.image}}
ignore_error: true
- cmd: docker rmi {{.image}}:{{.version}}
ignore_error: true
- cmd: >
docker build --rm
-f docker/Dockerfile.{{.name}}
-t {{.image}} .
- cmd: >
docker tag {{.image}} {{.image}}:{{.version}}
pando/server:
cmds:
- task: docker-base
vars:
name: server
pando/worker:
cmds:
- task: docker-base
vars:
name: worker
test:
cmds:
- go test ./...
generate:
cmds:
- go generate ./...
wire-base:
dir: cmd/pando-{{.name}}
cmds:
- cmd: wire
silent: true
wire:
cmds:
- task: wire-base
vars:
name: worker
- task: wire-base
vars:
name: server