-
Notifications
You must be signed in to change notification settings - Fork 50
/
Taskfile.yaml
51 lines (46 loc) · 1.33 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
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"
tasks:
default: { cmds: [task --list], silent: true }
dev:lint:
aliases: [lint]
cmds:
- terraform fmt -recursive
desc: Lint terraform code
examples:hcloud:setup:
aliases: [test, dev:test]
cmds:
- terraform init
- terraform validate
- terraform apply -auto-approve
- terraform output -raw kubeconfig > kubeconfig~
desc: Test this terraform module on Hetzner Cloud
dir: examples/hcloud-k3s
generates:
- kubeconfig~
interactive: true
requires:
vars: [HCLOUD_TOKEN]
sources:
# - "../../*.tf"
- "*.tf"
examples:hcloud:teardown:
cmds:
- terraform destroy -auto-approve
- rm -f kubeconfig~
desc: Remove all resources created by test:hcloud:setup
dir: examples/hcloud-k3s
interactive: true
preconditions:
- sh: test -f kubeconfig~
msg: Run `test:hcloud:setup` first
prompt: Are you sure you want to destroy all resources created by `test:hcloud:setup`?
requires:
vars: [HCLOUD_TOKEN]
e2e:hcloud:
aliases: [e2e]
cmds:
- task: examples:hcloud:setup
- defer: task examples:hcloud:teardown
- kubectl --kubeconfig examples/hcloud-k3s/kubeconfig~ get nodes
desc: Run e2e tests on Hetzner Cloud