-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
55 lines (48 loc) · 1.29 KB
/
Copy pathTaskfile.yml
File metadata and controls
55 lines (48 loc) · 1.29 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
46
47
48
49
50
51
52
53
54
55
version: '3'
vars:
TASKER_DB_DSN: '{{.TASKER_DB_DSN | default ""}}'
tasks:
help:
desc: print this help message
cmds:
- task --list-all
silent: true
confirm:
desc: confirmation prompt
cmds:
- |
echo -n 'Are you sure? [y/N] ' && read ans && [ ${ans:-N} = y ]
silent: true
internal: true
run:
desc: run the cmd/go-boilerplate application
cmds:
- go run ./cmd/tasker
migrations:new:
desc: create a new database migration
vars:
NAME: '{{.name | default ""}}'
cmds:
- |
if [ -z "{{.NAME}}" ]; then
echo "Error: name parameter is required"
echo "Usage: task migrations:new name=migration_name"
exit 1
fi
- echo 'Creating migration file for {{.NAME}}...'
- tern new -m ./internal/database/migrations {{.NAME}}
migrations:up:
desc: apply all up database migrations
deps: [ confirm ]
cmds:
- echo 'Running up migrations...'
- tern migrate -m ./internal/database/migrations --conn-string {{.TASKER_DB_DSN}}
tidy:
desc: format all .go files, and tidy and vendor module dependencies
cmds:
- echo 'Formatting .go files...'
- go fmt ./...
- echo 'Tidying module dependencies...'
- go mod tidy
- echo 'Verifying dependencies...'
- go mod verify