Files
pgbackweb/taskfile.yaml
2024-09-05 01:44:12 -06:00

107 lines
1.8 KiB
YAML

version: "3"
interval: 500ms
dotenv: [".env"]
tasks:
on:
cmds:
- docker compose up -d --build
- docker compose exec app /bin/bash
off:
cmd: docker compose down
dev:
watch: true
sources:
- "**/*.go"
- "**/*.sql"
- "**/*.js"
- "**/*.css"
- "**/*.json"
- ".env"
- exclude: "tmp/**"
- exclude: "dist/**"
- exclude: "internal/database/dbgen/**"
- exclude: "internal/view/static/css/style.css"
- exclude: "**/*.gen.go"
- exclude: "**/*.sql.go"
- exclude: "**/*_test.go"
- exclude: "**/_generated.go"
cmds:
- kill-port 8085
- task build
- task serve
build:
deps:
- clean
- gen-db
- gen-css
cmds:
- task fmt
- go build -o ./dist/app ./cmd/app/.
- go build -o ./dist/change-password ./cmd/changepw/.
serve:
cmd: ./dist/app
migrate-serve:
cmds:
- task goose -- up
- task serve
run:
cmds:
- task build
- task serve
goose:
cmd: eval $(go run ./cmd/goose/. {{.CLI_ARGS}})
gen-db:
cmd: sqlc generate
reset-db:
cmd: go run ./cmd/resetdb/.
gen-css:
cmd: >
npm run tailwindcss --
--config ./tailwind.config.js
--input ./internal/view/static/css/main.css
--output ./internal/view/static/css/style.css --minify
tidy:
cmd: go mod tidy
fmt:
cmds:
- go fmt ./...
- npm run standard
lint-only:
cmds:
- task gen-db
- golangci-lint run ./...
test-only:
cmds:
- task gen-db
- go test ./...
test:
cmds:
- task lint-only
- task test-only
clean:
cmds:
- rm -rf ./tmp
- rm -rf ./dist
fixperms: # Fixes the permissions of the files in the project
cmd: ./scripts/fixperms.sh