-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
158 lines (134 loc) · 4.75 KB
/
Taskfile.yaml
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
version: '3'
includes:
tools:
taskfile: ./.tasks/tools.yaml
internal: true
lint:
taskfile: ./.tasks/lint.yaml
internal: true
test: ./.tasks/test.yaml
cluster: ./.tasks/minikube.yaml
helm: ./.tasks/helm.yaml
build: ./.tasks/build.yaml
dev: ./.tasks/dev.yaml
samples: ./.tasks/samples.yaml
envoy: ./.tasks/envoy.yaml
vars:
# Project-specific variables
LOCALBIN: '{{.ROOT_DIR}}/bin'
GOBIN:
sh: echo "${GOBIN:-$(go env GOPATH)/bin}"
PLATFORMS: linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
# Tool versions
GO_VERSION: '1.22'
ENVTEST_K8S_VERSION: 1.30.0
KUBERNETES_VERSION: v1.30.5
KUSTOMIZE_VERSION: v5.4.2
CONTROLLER_TOOLS_VERSION: v0.16.0
ENVTEST_VERSION: release-0.18
GOLANGCI_LINT_VERSION: v1.57.2
HELMIFY_VERSION: v0.4.13
# Development environment
ENV: development # Set the environment to 'development' or 'production'
LOG_LEVEL: debug
USE_MINIKUBE_CONTEXT: '{{.USE_MINIKUBE_CONTEXT | default "true"}}'
IGNORE_NOT_FOUND: '{{.IGNORE_NOT_FOUND | default "false"}}'
IMG: '{{.IMG | default "jaceroio/kode-operator:v0.0.0-latest"}}'
# Concatenation
CONCAT_DIRECTORY: '{{.ROOT_DIR}}/'
CONCAT_INCLUDE_COMMON: 'v1alpha2/common_types.go,v1alpha2/reference_types.go,v1alpha2/shared_containertemplate_types.go,v1alpha2/containertemplate_types.go,common/*,constant/*,cleanup/*,event/*,resource/*,template/*,test/integration/*'
CONCAT_INCLUDE_PKG: 'pkg/constant/*,pkg/validation/*,pkg/envoy/*'
# CONCAT_INCLUDE_TASK: '.tasks/*'
CONCAT_INCLUDE_API: 'v1alpha2/validation.go,v1alpha2/condition.go'
CONCAT_INCLUDE_KODE: 'v1alpha2/kode_types.go,v1alpha2/envoy_types.go,v1alpha2/initplugin_types.go,controllers/kode/*'
# CONCAT_INCLUDE_ENTRYPOINT: 'v1alpha2/entrypoint_types.go,controllers/entrypoint/*'
CONCAT_INCLUDE_TEST: 'test/integration/*'
CONCAT_EXCLUDE_PATTERNS: '*_test.go,zz_generated.deepcopy.go'
CONCAT_INCLUDE_PATTERNS: '{{.CONCAT_INCLUDE_COMMON}},{{.CONCAT_INCLUDE_KODE}},{{.CONCAT_INCLUDE_ENTRYPOINT}},{{.CONCAT_INCLUDE_TASK}},{{.CONCAT_INCLUDE_PKG}},{{.CONCAT_INCLUDE_API}},{{.CONCAT_INCLUDE_TEST}}'
tasks:
default:
cmds:
- task --list
fmt:
desc: Run go fmt
cmds:
- task: lint:fmt
lint:
desc: Run go vet
cmds:
- task: lint:vet
generate:
desc: Generate code and manifests
cmds:
- task: build:generate
- task: build:manifests
setup:
silent: true
desc: Setup the development environment
cmds:
- task: tools:setup
- task: cluster:ensure
- task: dev:install
- task: envoy:install
- echo "Development environment is ready!"
vars:
USE_MINIKUBE_CONTEXT: true
setup-github-actions:
desc: Setup the github environment
cmds:
- task: tools:ensure-dir
- task: tools:kustomize
- task: tools:controller-gen
- task: tools:envtest
- task: tools:golangci-lint
teardown:
desc: Tear down the complete development environment
cmds:
- task: cluster:teardown
- echo "Development environment has been torn down."
vars:
USE_MINIKUBE_CONTEXT: true
run:
desc: Run the controller
cmds:
- task: dev:install
- task: dev:run
install:
desc: Install CRDs into the cluster (Kind by default, or existing kubecontext)
cmds:
- task: dev:install
uninstall:
desc: Uninstall CRDs from the cluster (Kind by default, or existing kubecontext)
cmds:
- task: dev:uninstall
apply:
desc: Apply manifests to the cluster
cmds:
- task: samples:apply
delete:
desc: Delete manifests from the cluster
cmds:
- task: samples:delete
concat:
desc: |
Concatenate project files based on include and exclude patterns.
This task processes files in the specified directory, filtering them based on
include and exclude patterns, and concatenates their contents into a single output file.
It also removes multiline comments from the concatenated content.
Usage:
task concat
To override default patterns or directory:
task concat CONCAT_EXCLUDE_PATTERNS='pattern1,pattern2' CONCAT_INCLUDE_PATTERNS='pattern3,pattern4' CONCAT_DIRECTORY='./src/'
Variables:
CONCAT_EXCLUDE_PATTERNS: Comma-separated list of patterns to exclude
CONCAT_INCLUDE_PATTERNS: Comma-separated list of patterns to include
CONCAT_DIRECTORY: Directory to process (should end with a slash)
Output:
The concatenated content is written to 'concatenated_output.txt' in the current directory.
cmds:
- |
CONCAT_EXCLUDE_PATTERNS="{{.CONCAT_EXCLUDE_PATTERNS}}" \
CONCAT_INCLUDE_PATTERNS="{{.CONCAT_INCLUDE_PATTERNS}}" \
CONCAT_DIRECTORY="{{.CONCAT_DIRECTORY}}" \
sh {{.TASKFILE_DIR}}/.tasks/concat.sh
silent: false