-
-
Notifications
You must be signed in to change notification settings - Fork 110
/
Copy pathTaskfile.yml
114 lines (92 loc) · 2.64 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
version: '3'
vars:
BINARY_NAME: thunderdome-planning-poker
BINARY_UNIX: $(BINARY_NAME)_unix
BINARY_WINDOWS: $(BINARY_NAME).exe
SWAGGER_DOCS_DIR: docs/swagger
tasks:
install:
cmds:
- go mod download
- go install github.com/swaggo/swag/cmd/[email protected]
- go install github.com/pressly/goose/v3/cmd/goose@latest
- 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_UNIX}}
- rm -f {{.BINARY_WINDOWS}}
- rm -rf ui/dist
- rm -rf release
- rm -rf {{ .SWAGGER_DOCS_DIR }}
gen-swag:
cmds:
- swag fmt
- 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:
- 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 thunderdome-planning-poker -v
build-linux:
deps: [ gen-swag, build-ui ]
cmds:
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o {{.BINARY_UNIX}} -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 thunderdome-planning-poker -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
run:
cmds:
- HTTP_SECURE_PROTOCOL="false" SMTP_ENABLED="false" DB_HOST="localhost" APP_DOMAIN="localhost" COOKIE_SECURE="false" ./$(BINARY_NAME)