generated from n3tuk/template-terraform-configuration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
129 lines (118 loc) · 3.54 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
---
version: 3
output: prefixed
interval: 2000ms
includes:
utils:
taskfile: .taskfiles/utils.yaml
internal: true
terraform:
taskfile: terraform/Taskfile.yaml
dir: terraform
tasks:
develop:
desc: Continiously run the development and integration tasks in the background
summary: |-
Clean (once) the environment and then continiously run the development and
integration tasks in the background for all configurations, testing and
checking any changes made while the code is changed, and keeping the
documentation up-to-date.
silent: true
watch: true
deps:
- task: utils:pre-commit
- task: utils:pre-checks
- task: clean
cmds:
- task: lint
- task: validate
- task: security
- task: test
- task: documentation
workspace:*:
desc: Select the Terraform Workspace to use for planning and deployment
summary: |-
Select the Terraform Workspaces which will be used to manage the specific
environmens these configurations will be planned, and deployed, for.
silent: true
cmds:
- task: terraform:workspace:{{ index .MATCH 0 }}
validate:
desc: Validate the Terraform configuration
summary: |-
Check and validate the syntax of the Terraform configurations to ensure
that the code it is correct and valid.
deps:
- task: terraform:validate
silent: true
lint:
desc: Lint all Terraform amd associated files within this repository
summary: |-
Run checks across the Terraform configurations, as well as the repository,
to find any potential issues with the configurations before run-time.
silent: true
deps:
- task: terraform:lint
- task: prettier
- task: markdownlint
prettier:
internal: true
silent: true
sources:
- '.prettier.yaml'
- '**/*.json'
- '**/*.yaml'
- '**/*.md'
cmds:
- cmd: |-
prettier --log-level warn \
--write --config .prettier.yaml \
--cache --cache-location .prettier.cache \
"**/*.{json,yaml,md}"
markdownlint:
internal: true
silent: true
sources:
- '.markdownlint.yaml'
- '*.md'
cmds:
- cmd: |-
markdownlint \
--config .markdownlint.yaml \
*.md
security:
desc: Run static analysis against Terraform configurations
summary: |-
Run static analysis tools across the Terraform configurations to find any
bad configurations or potential security issues.
silent: true
deps:
- task: terraform:security
documentation:
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.
silent: true
deps:
- task: terraform:documentation
test:
desc: Run tests against Terraform configurations
summary: |-
Run unit and integration tests against all the Terraform configurations to
ensure that any code or deployable resources are valid and correct.
silent: true
deps:
- task: terraform:test
clean:
desc: Clean temporary files from the repository and configurations
summary: |-
Clean any temporary directories and files created by both this Taskfile,
and the tools and applications called from it, and from within the
configurations.
silent: true
run: once
cmds:
- task: terraform:clean
- cmd: rm -rf .task