-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTaskfile.yml
62 lines (61 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
62
version: "3"
env:
DB_DIALECT: postgres
DB_HOST: localhost
DB_PORT: 5432
DB_NAME: bookly
DB_USER: postgres
DB_PASSWORD: postgres
DB_SILENCE_LOGGER: false
DB_SLOW_THRESHOLD_MILLISECONDS: 1000
JWT_SALT: salt
JWT_SECRET_KEY: secret
INTERNAL_TOKEN: secret
LOG_LEVEL: debug
tasks:
dev:
cmds:
- docker compose -f deploy/dev/docker-compose.yaml up --build
remove-dev:
cmds:
- docker compose -f deploy/dev/docker-compose.yaml down
test:
cmds:
- go test -v ./...
fmt:
cmds:
- gofmt -s -w -l .
- goimports -w -local github.com/omegaatt36/bookly $(find . -type f -name '*.go')
- gci write -s standard -s default -s "Prefix(github.com/omegaatt36/bookly)" --skip-generated .
- go mod tidy
lint:
cmds:
- golangci-lint run -v --timeout=60s
- revive -formatter friendly -config revive.toml ./...
- find . -name "*.json" | xargs -n 1 -t gojq . > /dev/null
- go vet -all ./...
- misspell -error */**
- staticcheck $(go list ./...)
build-lint:
cmds:
- docker build -t omegaatt36/bookly-lint:latest -f deploy/dev/Dockerfile.lint .
- echo "Build image finished, please run 'docker push omegaatt36/bookly-lint:latest'"
live-api:
cmds:
- air --build.cmd "go build -o build/api cmd/api/main.go" --build.bin "./build/api"
live-web:
cmds:
- air --build.cmd "go build -o build/web cmd/web/main.go" --build.bin "./build/web"
setup-db:
desc: Setup the database
cmds:
- docker compose -f deploy/dev/docker-compose.yaml up postgres adminer -d
remove-db:
desc: Remove the database
cmds:
- docker compose -f deploy/dev/docker-compose.yaml down postgres adminer
migrate-api:
# env:
# ROLLBACK_LAST: true
cmds:
- go run cmd/api-dbmigration/main.go