generated from n3tuk/template-terraform-configuration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
112 lines (101 loc) · 2.86 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
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
---
version: 3
output: prefixed
interval: 1000ms
includes:
configuration:
taskfile: .taskfiles/configuration.yaml
dir: terraform
local:
taskfile: .taskfiles/local.yaml
optional: true
tasks:
default:
desc: Run the default tasks
deps:
- task: pre-checks
- task: pre-commit
cmds:
- task: validate
- task: docs
- task: lint
- task: security
run:
desc: Run the all the tasks
summary: |
Force run (by first cleaning up) all the tasks for both the Terraform
Configuration, including initialisation, validation, formatting checks,
security analysis, and integration testing of the Module examples using
TerraTest.
cmds:
- task: clean
- task: validate
- task: docs
- task: lint
- task: security
pre-checks:
desc: Check the environment before running
internal: true
silent: true
run: once
cmds:
- cmd: |
test -x "$(which pre-commit 2>/dev/null)" \
|| (echo "Cannot find 'pre-commit'. Please install before trying again."; exit 1)
status:
# Setting this file will bypass pre-checks (only use if you are sure)
- test -f ../.skip-pre-checks
pre-commit:
desc: Set up the pre-commit hook in this repository
internal: true
silent: true
deps:
- task: pre-checks
cmds:
- cmd: pre-commit install
generates:
- .git/hooks/pre-commit
status:
- test -f .git/hooks/pre-commit
docs:
desc: Update README.md files with terraform-docs
summary: |
Update all README.md files in this Terraform configuration using
terraform-docs to ensure that all documentation is up-to-date with the
current configuration.
cmds:
- task: configuration:docs
fmt:
desc: Reformat the files
summary: |
Reformat the Terraform configuration using terraform.
cmds:
- task: configuration:fmt
validate:
desc: Validate the Terraform configuration
summary: |
Validate the Terraform configuration to ensure that the code is correct
and can be processed by Terraform.
cmds:
- task: configuration:validate
lint:
desc: Lint the Terraform configuration
summary: |
Run linting checks across the Terraform configuration with tflint to find
any potential issues with the configurations before run-time deployment.
cmds:
- task: configuration:lint
security:
desc: Run static analysis against Terraform
summary: |
Run static analysis across the Terraform workspace to find any bad
configurations or potential security issues.
cmds:
- task: configuration:security
clean:
desc: Clean temporary files from the repository
summary: |
Remove any temporary files from the configuration.
cmds:
- task: configuration:clean
- cmd: rm -rf .task