-
Notifications
You must be signed in to change notification settings - Fork 372
/
Taskfile.yml
99 lines (84 loc) · 2.14 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
version: 3
dotenv: [.env]
tasks:
default:
deps: [build]
cmds:
- ./server.exe
sources:
- app/**/*.go
- internal/**/*.go
- cmd/**/*.go
build:
cmds:
- go build -o server.exe -ldflags="-X 'github.com/openmultiplayer/web/internal/version.Version={{.VERSION}}'" -buildvcs=false ./cmd/server
# Production deployment run - migrate DB first, then
production:
cmds:
- npx prisma migrate deploy
- ./server.exe
deploy:
cmds:
- docker compose up --detach
services:
cmds:
- docker-compose -f docker-compose.dev.yml up -d
generate:
cmds:
# Generate main database bindings
- npx prisma generate
# Generate Burgershot (MyBB) database bindings
- npx prisma generate --schema=./prisma/burgershot.prisma
# Also generate TypeScript type declarations from some backend structs.
- go run types.go
docsindex:
cmds:
- go run ./cmd/indexbuilder/main.go
migrate:
cmds:
- npx prisma migrate dev
dbuild:
cmds:
- docker build -t southclaws/openmp-index .
- docker build -t southclaws/openmp-frontend -f Dockerfile.frontend .
upload-assets:
dir: frontend/public
cmds:
- mc cp --recursive images omp/assets
build-email-templates:
dir: emails
cmds:
- npm run build
# Run the web frontend and use a local API server.
web:
dir: frontend
env:
NEXT_PUBLIC_API_ADDRESS: "http://localhost:8000"
NEXT_PUBLIC_WEB_ADDRESS: "http://localhost:3000"
cmds:
- npm run dev
# Run the web frontend and use the live API.
web-live:
dir: frontend
env:
NEXT_PUBLIC_API_ADDRESS: "https://api.open.mp"
cmds:
- npm run dev
db-copy:
vars:
LOCAL_OUTPUT_PATH: data/dump.tar
cmds:
# - mkdir -p outputs/database
- pg_dump
--format=c
--file={{.LOCAL_OUTPUT_PATH}}
--schema=public
{{.DATABASE_URL_SOURCE}}
- pg_restore
--format=c
--schema=public
--single-transaction
--if-exists
--clean
--dbname={{.DATABASE_URL_DEST}}
{{.LOCAL_OUTPUT_PATH}}