-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
57 lines (51 loc) · 1.53 KB
/
Taskfile.yml
File metadata and controls
57 lines (51 loc) · 1.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
---
version: "3"
dotenv:
- .env
- ../.env
tasks:
default:
desc: List available tasks
cmds:
- task --list-all
create:
desc: Create all resources
dir: infrastructure/
cmds:
- tofu init -backend-config="bucket=${STATE_BUCKET_NAME}" -backend-config="key=${STATE_BUCKET_KEY}" -upgrade
- tofu apply -auto-approve
env:
AWS_ACCESS_KEY_ID:
sh: echo "${STATE_BUCKET_ACCESS_KEY}"
AWS_SECRET_ACCESS_KEY:
sh: echo "${STATE_BUCKET_SECRET_KEY}"
TF_VAR_hcloud_token:
sh: echo "${HCLOUD_TOKEN}"
delete:
desc: Destroy all resources
dir: infrastructure/
cmds:
- cmd: tofu state rm 'module.kubernetes.talos_machine_configuration_apply.worker'
ignore_error: true
- cmd: tofu state rm 'module.kubernetes.talos_machine_configuration_apply.control_plane'
ignore_error: true
- cmd: tofu state rm 'module.kubernetes.talos_machine_secrets.this'
ignore_error: true
- cmd: tofu destroy -auto-approve
- cmd: rm -rf terraform terraform.lock.hcl ../.kubeconfig ../.kubeconfig.bak ../.talosconfig ../.talosconfig.bak
env:
AWS_ACCESS_KEY_ID:
sh: echo "${STATE_BUCKET_ACCESS_KEY}"
AWS_SECRET_ACCESS_KEY:
sh: echo "${STATE_BUCKET_SECRET_KEY}"
TF_VAR_hcloud_token:
sh: echo "${HCLOUD_TOKEN}"
validate:
desc: Run syntax and linting checks
cmds:
- cmd: tflint --chdir infrastructure/
recreate:
desc: Recreate all resources
cmds:
- task: delete
- task: create