-
Notifications
You must be signed in to change notification settings - Fork 2
/
Taskfile.yml
39 lines (35 loc) · 1.06 KB
/
Taskfile.yml
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
version: '3'
tasks:
build:
cmds:
- go build ./...
gen-all:
cmds:
- for:
- advanced
- outputs
- resource_create
- resource_delete
- resource_replace
- resource_update
- sensitive
task: generate-one
vars:
RESOURCE_DIR: '{{ .ITEM }}'
gen-*:
cmds:
- task: generate-one
vars:
RESOURCE_DIR: '{{index .MATCH 0}}'
generate-one:
internal: true
cmds:
- rm -rf testdata/tmp
- mkdir testdata/tmp
- terraform -chdir=testdata/tmp init -reconfigure -from-module=../{{ .RESOURCE_DIR }}/before
- terraform -chdir=testdata/tmp apply -auto-approve
- cp testdata/{{ .RESOURCE_DIR }}/after/main.tf testdata/tmp
- terraform -chdir=testdata/tmp plan -out plan.out
- terraform -chdir=testdata/tmp show -json plan.out | jq . > testdata/{{ .RESOURCE_DIR }}/plan.json
- rm -rf testdata/tmp
- go run . --no-color testdata/{{ .RESOURCE_DIR }}/plan.json > testdata/{{ .RESOURCE_DIR }}/output.golden