-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
47 lines (37 loc) · 1.15 KB
/
Taskfile.yaml
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
version: '3'
dotenv: ['.env']
tasks:
#APP SCRIPTS
run/api:
- go run ./cmd/api -version -db-dsn=$MOVIE_DB_DSN
build/api:
- echo 'Building cmd/api...'
- go build -ldflags='-s' -o=./bin/api ./cmd/api
#DB SCRIPTS
db/psql:
- psql $MOVIE_DB_DSN
db/migrations/new:
- echo 'Creating migration files named {{.name}}...'
- migrate create -seq -ext=.sql -dir=./migrations {{.name}}
db/migrations/up:
- echo "Running up migrations..."
- migrate -path ./migrations -database $MOVIE_DB_DSN up
#MAINTENANCE SCRIPTS
audit:
- task: vendor
- echo 'Tidying and verifying module dependencies...'
- go mod tidy
- go mod verify
- echo 'Formatting code...'
- go fmt ./...
- echo 'Vetting code...'
- go vet ./...
- staticcheck ./...
- echo 'Running tests...'
- go test -race -vet=off ./...
vendor:
- echo 'Tidying and verifying module dependencies...'
- go mod tidy
- go mod verify
- echo 'Vendoring dependencies...'
- go mod vendor