-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
104 lines (90 loc) · 2.15 KB
/
Taskfile.yml
File metadata and controls
104 lines (90 loc) · 2.15 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
version: '3'
vars:
BINARY_NAME: update-controller
DOCKER_IMAGE: ghcr.io/udl-tf/update-controller
TAG:
sh: echo "${TAG:-latest}"
tasks:
default:
desc: Run tests and build
cmds:
- task: test
- task: build
build:
desc: Build the controller binary
cmds:
- echo "Building {{.BINARY_NAME}}..."
- go build -o {{.BINARY_NAME}} ./cmd/controller
sources:
- "**/*.go"
- go.mod
- go.sum
generates:
- "{{.BINARY_NAME}}"
test:
desc: Run tests
cmds:
- echo "Running tests..."
- go test -v ./...
test-race:
desc: Run tests with race detection
cmds:
- echo "Running tests with race detection..."
- go test -race -v ./...
clean:
desc: Clean build artifacts
cmds:
- echo "Cleaning..."
- rm -f {{.BINARY_NAME}}
- go clean
docker-build:
desc: Build Docker image
cmds:
- echo "Building Docker image {{.DOCKER_IMAGE}}:{{.TAG}}..."
- docker build -t {{.DOCKER_IMAGE}}:{{.TAG}} .
docker-push:
desc: Push Docker image
deps:
- docker-build
cmds:
- echo "Pushing Docker image {{.DOCKER_IMAGE}}:{{.TAG}}..."
- docker push {{.DOCKER_IMAGE}}:{{.TAG}}
run:
desc: Run controller locally (requires kubeconfig)
cmds:
- echo "Running controller locally..."
- go run ./cmd/controller --kubeconfig={{.HOME}}/.kube/config
vars:
HOME:
sh: echo $HOME
run-debug:
desc: Run controller with debug logging
cmds:
- echo "Running controller with debug logging..."
- go run ./cmd/controller --kubeconfig={{.HOME}}/.kube/config
env:
LOG_LEVEL: debug
vars:
HOME:
sh: echo $HOME
deps:
desc: Install dependencies
cmds:
- echo "Installing dependencies..."
- go mod download
- go mod tidy
fmt:
desc: Format code
cmds:
- echo "Formatting code..."
- go fmt ./...
lint:
desc: Lint code (requires golangci-lint)
cmds:
- echo "Linting code..."
- golangci-lint run
generate:
desc: Generate code
cmds:
- echo "Generating code..."
- go generate ./...