Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
59 lines (49 loc) · 1.39 KB
/
Copy pathTaskfile.yml
File metadata and controls
59 lines (49 loc) · 1.39 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
version: '3'
vars:
BINARY_NAME: moley
VERSION:
sh: git describe --tags --always --dirty
COMMIT:
sh: git rev-parse --short HEAD
BUILD_TIME:
sh: date -u '+%Y-%m-%d_%H:%M:%S'
LDFLAGS: -ldflags "-X 'github.com/stupside/moley/v2/internal/version.Version={{.VERSION}}' -X 'github.com/stupside/moley/v2/internal/version.Commit={{.COMMIT}}' -X 'github.com/stupside/moley/v2/internal/version.BuildTime={{.BUILD_TIME}}'"
tasks:
clean:
desc: Clean build artifacts
cmds:
- rm -f {{.BINARY_NAME}}
# Go build tasks
go:build:
desc: Build the application
cmds:
- go build {{.LDFLAGS}} -o {{.BINARY_NAME}} .
go:modernize:
desc: Apply Go modernization fixes
cmds:
- go fix ./...
go:test:
desc: Run Go tests with the race detector
cmds:
- go test -race ./...
go:lint:
desc: Check Go code
cmds:
- go vet ./...
- test -z "$(gofmt -l .)"
docs:check:
desc: Validate and build documentation
dir: docs
cmds:
- yarn install --immutable
- yarn typecheck
- yarn build
# Docker tasks
docker:moley:
desc: Run moley commands in Docker (pass args after --)
cmds:
- docker compose run --rm moley {{.CLI_ARGS}}
docker:cloudflared:
desc: Run cloudflared commands in Docker (pass args after --)
cmds:
- docker compose run --rm --entrypoint cloudflared moley {{.CLI_ARGS}}