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.min.css" - exclude: "internal/view/static/js/app.min.js" - exclude: "**/*.gen.go" - exclude: "**/*.sql.go" - exclude: "**/*_test.go" - exclude: "**/_generated.go" cmds: - npm run kill-port -- 8085 - task build - task serve build: deps: - clean - gen-db - build-static 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: silent: true cmd: > goose -dir ./internal/database/migrations postgres "{{.PBW_POSTGRES_CONN_STRING}}" {{.CLI_ARGS}} gen-db: cmd: sqlc generate reset-db: cmd: go run ./cmd/resetdb/. build-static: silent: true cmds: - > npm run tailwindcss -- --config ./tailwind.config.js --input ./internal/view/static/css/style.css --output ./internal/view/static/css/style.min.css --minify - > npm run esbuild -- ./internal/view/static/js/app.js --bundle --minify --outfile=./internal/view/static/js/app.min.js tidy: cmd: go mod tidy fmt: cmds: - go fmt ./... - npm run standard -- --fix 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