-
-
Notifications
You must be signed in to change notification settings - Fork 115
/
Copy pathTaskfile.yml
123 lines (99 loc) · 2.87 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
version: '3'
vars:
BINARY_NAME: thunderdome-planning-poker
BINARY_LINUX: thunderdome-planning-poker_unix
BINARY_WINDOWS: thunderdome-planning-poker.exe
SWAGGER_DOCS_DIR: docs/swagger
tasks:
install:
cmds:
- go mod download
- npm ci --prefix ui
update-ui-deps:
cmds:
- npm update --prefix ui
update-go-deps:
cmds:
- go get -u ./...
clean:
cmds:
- rm -f {{.BINARY_NAME}}
- rm -f {{.BINARY_LINUX}}
- rm -f {{.BINARY_WINDOWS}}
- rm -rf ui/dist
- rm -rf release
- rm -rf {{ .SWAGGER_DOCS_DIR }}
gen-swag:
cmds:
- go tool swag fmt
- go tool swag init -g internal/http/http.go -o {{ .SWAGGER_DOCS_DIR }}
gen-i8n:
cmds:
- npm run locales --prefix ui
fmt-ui:
deps: [ gen-i8n ]
cmds:
- npm run format --prefix ui
fmt-e2e:
cmds:
- npm run format --prefix e2e
fmt-go:
deps: [ gen-swag ]
cmds:
- go tool goimports -w .
format:
deps: [ fmt-go, fmt-ui, fmt-e2e ]
test-go:
cmds:
- go test -v ./... | grep -v {{ .SWAGGER_DOCS_DIR }}
build-ui:
deps: [ fmt-ui ]
cmds:
- npm run build --prefix ui
build-go:
deps: [ fmt-go ]
cmds:
- go build -o {{.BINARY_NAME}} -v
build-linux:
deps: [ gen-swag, build-ui ]
cmds:
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o {{.BINARY_LINUX}} -v
build-windows:
deps: [ gen-swag, build-ui ]
cmds:
- CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o {{.BINARY_WINDOWS}} -v
build:
deps: [ fmt-go, build-ui ]
cmds:
- go build -o {{.BINARY_NAME}} -v
dev:
deps: [ build-ui ]
cmds:
- task: build
- HTTP_SECURE_PROTOCOL="false" SMTP_ENABLED="false" DB_HOST="localhost" APP_DOMAIN="localhost" COOKIE_SECURE="false" ./{{.BINARY_NAME}} live
dev-go:
cmds:
- task: build-go
- HTTP_SECURE_PROTOCOL="false" SMTP_ENABLED="false" DB_HOST="localhost" APP_DOMAIN="localhost" COOKIE_SECURE="false" ./{{.BINARY_NAME}} live
dev-secure:
cmds:
- task: build
- caddy start --config build/dev.caddyfile
- SMTP_ENABLED="false" DB_HOST="localhost" APP_DOMAIN="thunderdome.localhost" ./{{.BINARY_NAME}} live
dev-secure-go:
cmds:
- task: build-go
- caddy start --config build/dev.caddyfile
- SMTP_ENABLED="false" DB_HOST="localhost" APP_DOMAIN="thunderdome.localhost" ./{{.BINARY_NAME}} live
windows-build-go:
deps: [ fmt-go ]
cmds:
- go build -o {{.BINARY_WINDOWS}} -v
windows-dev-secure-go:
cmds:
- task: windows-build-go
- caddy start --config build/dev.caddyfile
- SMTP_ENABLED="false" DB_HOST="localhost" APP_DOMAIN="thunderdome.localhost" ./{{.BINARY_WINDOWS}} live
run:
cmds:
- HTTP_SECURE_PROTOCOL="false" SMTP_ENABLED="false" DB_HOST="localhost" APP_DOMAIN="localhost" COOKIE_SECURE="false" ./$(BINARY_NAME)