-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathTaskfile.yml
More file actions
133 lines (113 loc) · 4.53 KB
/
Taskfile.yml
File metadata and controls
133 lines (113 loc) · 4.53 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
version: "3"
vars:
USE_EXTERNAL_IP_WITH_LB: false
includes:
dev:
taskfile: ./dev/Taskfile.yaml
dir: ./dev
deployment-helm-chart:
taskfile: ./deploy/chart/kubesqlserver-operator/Taskfile.yaml
dir: ./deploy/chart/kubesqlserver-operator
doc-site:
taskfile: ./docs-site/Taskfile.yaml
dir: ./docs-site
tasks:
default:
cmds:
- task --list-all
desc: "List all available tasks in this Taskfile."
create-crd-files:
internal: true
dir: ./src/OperatorTemplate.Operator
cmds:
- rm -rf ./config || true
- mkdir ./config
- dotnet clean
- dotnet build -c Release
- rm -rf ./config/Dockerfile || true
desc: "Internal task: Generate a fresh configuration for the OperatorTemplate.Operator by cleaning and rebuilding the project."
copy-to-helm:
internal: true
dir: .
cmds:
- mkdir -p ./dev/dev-helm-chart/crds
- find ./src/OperatorTemplate.Operator/config -type f -name "*dotkube_io*" -exec cp {} ./dev/dev-helm-chart/crds/ \;
desc: "Internal task: Copy configuration and CRD files to the Helm chart directories."
create-crds-and-copy:
cmds:
- task: create-crd-files
- task: copy-to-helm
desc: "Create the Custom Resource Definitions (CRDs) for the OperatorTemplate.Operator and copy them to the Helm chart directories."
build-operator-image:
cmds:
- docker build -t operator-template:latest -f ./src/OperatorTemplate.Operator/Containerfile .
- docker tag operator-template:latest localhost:5000/operator-template:latest
# - docker push localhost:5000/operator-template:latest
desc: "Build the Docker image for the OperatorTemplate.Operator."
dev:
dir: ./src/OperatorTemplate.AppHost
cmds:
- dotnet watch
desc: "Start the development environment for the OperatorTemplate.AppHost with live file watching enabled."
quick-deploy:
cmds:
- docker pull mcr.microsoft.com/mssql/server:2022-latest
- task: dev:local-cluster:create-registry
- task: dev:local-cluster:delete
- task: dev:local-cluster:create
- |
if [[ "${USE_EXTERNAL_IP_WITH_LB}" == "true" ]]; then
echo "External IP with LoadBalancer is enabled."
task dev:local-cluster:add-metallb
else
echo "External IP with LoadBalancer is not enabled."
fi
- task: create-crds-and-copy
- task: build-operator-image
- task dev:local-cluster:loadimage -- localhost:5000/operator-template:latest
- task dev:local-cluster:loadimage -- mcr.microsoft.com/mssql/server:2022-latest
- task: dev:helm-chart:install-helm-chart
- task: dev:local-cluster:apply-crd-instance
desc: "Start the full OperatorTemplate stack in the Kind Kubernetes cluster."
quick-dev:
cmds:
- task: dev:local-cluster:delete
- task: dev:local-cluster:create
- |
if [[ "${USE_EXTERNAL_IP_WITH_LB}" == "true" ]]; then
echo "External IP with LoadBalancer is enabled."
task dev:local-cluster:add-metallb
else
echo "External IP with LoadBalancer is not enabled."
fi
- task: create-crds-and-copy
- task: dev:helm-chart:apply-crds-from-helm-chart
- task: dev:local-cluster:delete-external-sql-container
- task: dev:local-cluster:create-external-sql-container
- task: dev:local-cluster:apply-crd-instance
- task: dev:local-cluster:apply-external-crd-instance
- task: dev:local-cluster:apply-external-database-instance
- task: dev
quick-dev-tmux:
cmds:
- bash "./dev/local-configs/scripts/tmux-setup.sh"
desc: "Start the full OperatorTemplate stack in the Kind Kubernetes cluster with a Tmux session."
clean:
cmds:
- task: dev:local-cluster:delete
- task: dev:local-cluster:delete-external-sql-container
- dotnet clean
desc: "Clean up the Kind Kubernetes cluster."
build-release-helm-chart-and-yaml:
cmds:
- task: deployment-helm-chart:clear-out-chart
- cp -r ./dev/dev-helm-chart/crds/* ./deploy/chart/kubesqlserver-operator/crds/
- cp -r ./dev/dev-helm-chart/templates/* ./deploy/chart/kubesqlserver-operator/templates/
- cp -r ./dev/dev-helm-chart/tests/* ./deploy/chart/kubesqlserver-operator/tests/
- task: deployment-helm-chart:template-output-to-file
- cp ./deploy/chart/kubesqlserver-operator/output.yaml ./deploy/yaml/deploy.yaml
- task: deployment-helm-chart:template-output-to-file-cleanup
format:
cmds:
- dotnet format
desc: "Format the code using dotnet format."