-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
126 lines (104 loc) · 4.08 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
version: '3'
includes:
tools: ./.tasks/tools.yaml
lint: ./.tasks/lint.yaml
test: ./.tasks/test.yaml
cluster: ./.tasks/clusters.yaml
helm: ./.tasks/helm.yaml
build: ./.tasks/build.yaml
dev: ./.tasks/dev.yaml
samples: ./.tasks/samples.yaml
vars:
ENVTEST_K8S_VERSION: 1.30.0
GO_VERSION: '1.22'
GOBIN:
sh: echo "${GOBIN:-$(go env GOPATH)/bin}"
CONTAINER_TOOL: docker
PLATFORMS: linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
LOCALBIN: '{{.ROOT_DIR}}/bin'
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
KUBECTL: kubectl
KUSTOMIZE_CMD: '{{.LOCALBIN}}/kustomize-{{.KUSTOMIZE_VERSION}}'
CONTROLLER_GEN_CMD: '{{.LOCALBIN}}/controller-gen-{{.CONTROLLER_TOOLS_VERSION}}'
SETUP_ENVTEST_CMD: '{{.LOCALBIN}}/setup-envtest-{{.ENVTEST_VERSION}}'
GOLANGCI_LINT_CMD: '{{.LOCALBIN}}/golangci-lint-{{.GOLANGCI_LINT_VERSION}}'
HELMIFY_CMD: '{{.LOCALBIN}}/helmify-{{.HELMIFY_VERSION}}'
TEST_VERBOSITY: -v
ENV: development
LOG_LEVEL: debug
IGNORE_NOT_FOUND: '{{.IGNORE_NOT_FOUND | default "false"}}'
USE_KIND_CONTEXT: '{{.USE_KIND_CONTEXT | default "true"}}'
KIND_KUBECONFIG: '{{.KIND_KUBECONFIG | default "${HOME}/.kube/kind-config-test"}}'
KIND_CLUSTER_NAME: '{{.KIND_CLUSTER_NAME | default "test"}}'
KIND_CONTEXT: '{{ .KIND_CONTEXT | default "kind-test" }}'
IMG: '{{.IMG | default "emiljacero/kode-operator:v0.0.0-latest"}}'
CONCAT_DIRECTORY: '{{.ROOT_DIR}}/'
CONCAT_INCLUDE_COMMON: 'v1alpha2/common_types.go,common/*,status/*'
CONCAT_INCLUDE_KODE: 'v1alpha2/kode_types.go,controllers/kode/reconciler.go,controllers/kode/utils.go,controllers/kode/finalizer.go,controllers/kode/config.go'
CONCAT_INCLUDE_ENTRYPOINT: 'v1alpha2/entrypoint_types.go,controllers/entrypoint/reconciler.go,controllers/entrypoint/utils.go,controllers/entrypoint/finalizer.go,controllers/entrypoint/config.go,controllers/entrypoint/ensure_routes.go'
CONCAT_EXCLUDE_PATTERNS: 'zz_generated.deepcopy.go'
CONCAT_INCLUDE_PATTERNS: '{{.CONCAT_INCLUDE_COMMON}},{{.CONCAT_INCLUDE_KODE}},{{.CONCAT_INCLUDE_ENTRYPOINT}}'
tasks:
default:
cmds:
- task: list
list:
desc: Display all available tasks
cmds:
- task --list
fmt:
desc: Run go fmt
cmds:
- task: lint:fmt
generate:
desc: Generate code and manifests
cmds:
- task: build:generate
- task: build:manifests
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
run:
desc: Run the controller
cmds:
- 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