-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
61 lines (52 loc) · 1.8 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
# https://taskfile.dev
version: '3'
env:
# App
API_NAME: api_drugs
APP_SECRET: B@nk4I
# Database
DATABASE_DRIVER: pgx
DATABASE_URL: postgres://postgres:[email protected]/ionix
DATABASE_MAX_OPEN_CONNECTIONS: 25
DATABASE_MAX_IDDLE_CONNECTIONS: 25
DATABASE_MAX_IDDLE_TIME: 15m
# HTTP
HTTP_SERVER_IDLE_TIMEOUT: 60s
PORT: 8080
HTTP_SERVER_READ_TIMEOUT: 1s
HTTP_SERVER_WRITE_TIMEOUT: 2s
# JWT
JWT_PRIVATE_KEY: SecretMedicament
TOKEN_TTL: 300
# Context
CONTEXT_TIMEOUT: 10
tasks:
build:
cmds:
- env CGO_ENABLED=0 GOOS=linux go build -ldflags '-w -s' -a -installsuffix cgo -o bin/$API_NAME ./cmd/main.go
run:
deps:
- build
cmds:
- ./bin/$API_NAME
test:
desc: Run all tests ignoring cache
cmds:
- go test -cover -v ./... -count=1
clean:
cmds:
- rm -fr ./bin
dbUp:
cmds:
- migrate -path=./migrations -database=$(DATABASE_URL) up
dbDown:
cmds:
- migrate -path=./migrations -database=$(DATABASE_URL) down
mocks:
cmds:
- mockgen -source .\internal\interfaces\auth_service.go -destination .\internal\mocks\auth_service.go -package mocks
- mockgen -source .\internal\interfaces\drugs_service.go -destination .\internal\mocks\drugs_service.go -package mocks
- mockgen -source .\internal\interfaces\vaccinations_service.go -destination .\internal\mocks\vaccinations_service.go -package mocks
- mockgen -source .\internal\interfaces\auth_repository.go -destination .\internal\mocks\auth_repository.go -package mocks
- mockgen -source .\internal\interfaces\drugs_repository.go -destination .\internal\mocks\drugs_repository.go -package mocks
- mockgen -source .\internal\interfaces\vaccinations_repository.go -destination .\internal\mocks\vaccinations_repository.go -package mocks