-
-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathtaskfile.yml
More file actions
114 lines (96 loc) · 3.34 KB
/
taskfile.yml
File metadata and controls
114 lines (96 loc) · 3.34 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
113
114
version: "3"
env:
VERSION: 0.39.1-beta.1
silent: true
includes:
frontend:
taskfile: ./taskfile.frontend.yml
flatten: true
docker:
taskfile: ./taskfile.docker.yml
flatten: true
tasks:
# Development tasks
default:
desc: Run kiosk
deps: [build]
cmds:
- ./dist/kiosk
dev:
desc: Run kiosk in development mode
cmds:
- go tool air
verbose:
desc: Run kiosk in verbose debug mode
cmds:
- go tool air -build.cmd="task build-verbose" -build.full_bin="KIOSK_DEBUG_VERBOSE=true ./dist/kiosk"
# Backend tasks
templ:
desc: Generate templ templates
cmds:
- go tool templ generate
test:
desc: Run tests
deps: [templ]
cmds:
- go test ./...
- task: frontend:typecheck
lint:
desc: Run linters
cmds:
- golangci-lint run
- task: frontend:lint
# Build tasks
build:
desc: Build kiosk
deps: [frontend, templ]
cmds:
- CGO_ENABLED=0 go build -installsuffix cgo -ldflags "-X main.version={{.VERSION}} -s -w" -o dist/kiosk .
build-verbose:
desc: Build kiosk with face detection debugging enabled
deps: [frontend, templ]
cmds:
- CGO_ENABLED=0 go build -installsuffix cgo -ldflags "-X main.version={{.VERSION}} -X github.com/damongolding/immich-kiosk/routes.drawFacesOnImages=true -s -w" -o dist/kiosk .
# Maintenance tasks
install:
desc: Install development dependencies
deps: [frontend:install]
cmds:
- go mod tidy
preconditions:
- sh: golangci-lint --version
msg: golangci-lint is not installed. Please follow the instructions at https://golangci-lint.run/docs/welcome/install/local
- sh: gofumpt --version
msg: gofumpt is not installed. Please follow the instructions at https://github.com/mvdan/gofumpt
update-go:
desc: Sync local Go version with go.mod and Dockerfile
cmds:
- |
GO_VERSION_FULL=$(go version | awk '{print $3}' | sed 's/go//')
echo "📦 Updating go.mod to use Go $GO_VERSION_FULL"
go mod edit -go=$GO_VERSION_FULL
echo "🛠️ Updating Dockerfile to use Go $GO_VERSION_FULL"
sed -i.bak -E "s|golang:[0-9]+\.[0-9]+(\.[0-9]+)?-[[:alnum:]-]+|golang:${GO_VERSION_FULL}-bookworm|g" Dockerfile
echo "--- Dockerfile diff ---"
diff Dockerfile.bak Dockerfile || true
rm Dockerfile.bak
outdated-go:
desc: Check for outdated Go dependencies
cmds:
- (printf "Module\tCurrent\tLatest\n" && go list -u -m -json all | jq -r 'select(.Main or .Indirect | not) | select(.Update) | [.Path, .Version, .Update.Version] | @tsv') | column -t -s $'\t'
outdated:
desc: Check for outdated Go and frontend dependencies
deps: [outdated-go, frontend:outdated]
update-go-deps:
desc: Update Go dependencies
cmds:
- eval $(go list -u -m -json all | jq -rs '[.[] | select(.Main or .Indirect | not) | select(.Update) | .Path + "@latest"] | "go get " + join(" ")')
update-deps:
desc: Update Go and frontend dependencies
deps: [update-go-deps, frontend:update]
cmds:
- go mod tidy
openapi:
desc: Generate OpenAPI specification
cmds:
- go tool oapi-codegen --generate types,client -package immich_open_api https://raw.githubusercontent.com/immich-app/immich/refs/heads/main/open-api/immich-openapi-specs.json > internal/immich_open_api/immich_open_api.go