-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
47 lines (38 loc) · 1.05 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
version: '3'
dotenv:
- ".env"
tasks:
up:
cmds:
- docker compose up -d
down:
cmds:
- docker compose down
run:
cmds:
- go run ./cmd/api --jwt-secret=${JWT_SECRET} {{.CLI_ARGS}}
build:
cmds:
- echo Building API
- go build -ldflags='-s' -o=./bin/api ./cmd/api
- GOOS=linux GOARCH=amd64 go build -ldflags='-s' -o=./bin/linux_amd64/api ./cmd/api
migrate-up:
cmd: migrate -path ./migrations -database=$GREENLIGHT_DB_DSN up
migrate-down:
cmd: migrate -path ./migrations -database=$GREENLIGHT_DB_DSN down
migrate-drop:
cmd: migrate -path ./migrations -database=$GREENLIGHT_DB_DSN drop -f
new-migration:
cmd: migrate create -seq -ext=.sql -dir=./migrations {{.CLI_ARGS}}
audit:
cmds:
- 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 ./...