-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
112 lines (94 loc) · 2.56 KB
/
Taskfile.yml
File metadata and controls
112 lines (94 loc) · 2.56 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# https://taskfile.dev
version: '3'
includes:
dev: ./Taskfile_dev.yml
vars:
BINFILE: runrun
tasks:
default:
desc: "List available tasks"
preconditions:
- test -f .git/hooks/pre-commit
cmds:
- task -a
check-before-commit:
desc: "Run checks before committing"
preconditions:
- test -f .git/hooks/pre-commit
deps:
- test
- snapshot
cmds:
- task: lint
install-tools:
desc: "Install development tools"
cmds:
- go install github.com/a-h/templ/cmd/templ@latest
generate:
desc: "Generate templ templates"
cmds:
- templ generate
build-css:
desc: "Build CSS with Tailwind"
cmds:
- ./tools/tailwindcss -i internal/server/static/css/input.css -o internal/server/static/css/styles.css --minify
build-all:
desc: "Build all assets (CSS and application)"
deps: [generate, build-css, build]
watch-css:
desc: "Watch CSS changes (development)"
cmds:
- ./tools/tailwindcss -i internal/server/static/css/input.css -o internal/server/static/css/styles.css --watch
lint:
desc: "Run golangci-lint"
cmds:
- golangci-lint run
test:
desc: "Run unit tests with race detection"
cmds:
- go test -count=2 -race ./...
build:
desc: "Build the application"
deps: [generate, build-css]
cmds:
- CGO_ENABLED=0 go build -o {{.BINFILE}} ./cmd/runrun
image:
desc: "Build and push Docker image"
deps:
- build
cmds:
- docker build --no-cache --build-arg VERSION=development . -t ghcr.io/sgaunet/runrun:latest
- docker push ghcr.io/sgaunet/runrun:latest
run:
desc: "Run the server (development mode)"
deps: [generate]
cmds:
- go run ./cmd/runrun server --config configs/example.yaml
doc:
desc: "Start godoc documentation server"
cmds:
- echo http://localhost:6060
- godoc -http=:6060
snapshot:
desc: "Create snapshot release with goreleaser"
cmds:
- goreleaser --clean --snapshot
release:
desc: "Create production release with goreleaser"
cmds:
- goreleaser --clean
clean:
desc: "Clean build artifacts"
cmds:
- rm -f {{.BINFILE}}
- rm -f internal/server/static/css/styles.css
- find . -name "*_templ.go" -type f -delete
hash-password:
desc: "Hash a password for configuration (usage: task hash-password PASS=yourpassword)"
cmds:
- |
if [ -z "{{.PASS}}" ]; then
echo "Usage: task hash-password PASS=yourpassword"
exit 1
fi
./runrun hash-password {{.PASS}}