-
Notifications
You must be signed in to change notification settings - Fork 11
/
Taskfile.yml
71 lines (57 loc) · 1.17 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
version: 3
dotenv:
- .env
vars:
VERSION:
sh: git describe --always --tags
DOCKER_IMAGE_TAG: "storyden:{{.VERSION}}"
tasks:
default:
deps: [backend]
cmds:
- ./backend.exe
sources:
- cmd/**/*.go
- internal/**/*.go
- app/**/*.go
production:
cmds:
- ./backend.exe
backend:
cmds:
- go build -o backend.exe -ldflags="-X 'github.com/Southclaws/storyden/internal/config.Version={{.VERSION}}'" ./cmd/backend
backend:test:
cmds:
- go test ./...
# -
# Docker
# -
backend:image:build:
cmds:
- docker build -t {{.DOCKER_IMAGE_TAG}} .
backend:image:run:
cmds:
- docker run {{.DOCKER_IMAGE_TAG}}
# -
# Code generation
# -
generate:
deps: [generate:db, generate:openapi]
generate:db:
cmds: [go generate ./internal/ent]
generate:openapi:
deps: [generate:openapi:backend, generate:openapi:frontend]
generate:openapi:backend:
cmds: [go generate .]
generate:openapi:frontend:
dir: web
cmds: [yarn openapi]
# -
# Database
# -
seed:
cmds:
- go run ./cmd/seed
db:ui:
cmds:
- atlas schema inspect -d {{.DATABASE_URL}} -w