-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtaskfile.yaml
55 lines (48 loc) · 1.19 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
version: '3'
tasks:
default:
desc: "Show this list"
cmds:
- task --list-all
init:
internal: false
desc: "Run Terraform Init"
cmds:
- terraform init $PARAMETER
env:
PARAMETER: -upgrade
plan:
desc: "Run Terraform Plan"
cmds:
- terraform plan $PARAMETER
apply:
desc: "Run Terraform Apply"
cmds:
- terraform apply $PARAMETER
env:
PARAMETER: --auto-approve
create_cluster:
internal: false
desc: "Run Terraform Init and Create the cluster"
cmds:
- task: init
- task: apply
destroy:
internal: false
desc: "Run Terraform Destroy"
#preconditions:
# # Fail when terraform is not yet initialized
# - sh: if [ ! -a "./.terraform.lock.hcl" ]; then
# return 1
# fi
# msg: "Make sure that terraform is initialized first by running 'terraform init'"
cmds:
- terraform destroy $PARAMETER
env:
PARAMETER: --auto-approve
cleanup:
desc: "Terminate and perform cleanup of the cluster"
cmds:
- task: destroy
#- rm -Rvf .terraform terraform.* .terraform.lock.hcl
- find . -name '*terraform*' -print | xargs rm -Rf