-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
45 lines (36 loc) · 1.01 KB
/
Taskfile.yml
File metadata and controls
45 lines (36 loc) · 1.01 KB
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
version: "3"
dotenv:
- ".env"
vars:
MIGRATIONS_PATH: "./cmd/migrate/migrations"
tasks:
migrate-create:
desc: Create a new migration (task migrate-create -- name_here)
cmds:
- migrate create -seq -ext sql -dir "{{.MIGRATIONS_PATH}}" "{{.CLI_ARGS}}"
migrate-up:
desc: Apply all migrations
cmds:
- migrate -path="{{.MIGRATIONS_PATH}}" -database="{{.DB_ADDR}}" up
migrate-down:
desc: Roll back one migration
cmds:
- migrate -path="{{.MIGRATIONS_PATH}}" -database="{{.DB_ADDR}}" down
seed:
desc: Run seed script
cmds:
- go run cmd/migrate/seed/main.go
gen-docs:
desc: Generate Swagger docs
cmds:
- swag init -d cmd/api,internal/store -g main.go -o docs --parseDependency
- swag fmt
setup-hooks:
desc: Configure git to use project hooks (run once after cloning)
cmds:
- git config core.hooksPath .github/hooks
- echo "Git hooks configured successfully."
test:
desc: Run all Go tests
cmds:
- go test -v ./...