Skip to content

Commit d01e5ad

Browse files
committed
fix: terraform taskfile
1 parent 0ee82c4 commit d01e5ad

File tree

3 files changed

+27
-18
lines changed

3 files changed

+27
-18
lines changed

shared-files/taskfile/libraries/internal.yml

+16-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,22 @@ tasks:
1414
brew install {{.APP}} --quiet && \
1515
echo "✅ {{.APP}} installed successfully" || \
1616
echo "❌ Failed to install {{.APP}}"
17-
17+
18+
tools:brew:optional:
19+
desc: brew install
20+
silent: true
21+
preconditions:
22+
- sh: command -v brew
23+
msg: "brew is not installed. Please install brew. See CONTRIBUTING.md for the required tools"
24+
cmds:
25+
## Brew apps
26+
- cmd: |
27+
if [ {{.INSTALL_REQUIRED}} = true ]; then \
28+
brew install {{.APP}} --quiet && \
29+
echo "✅ {{.APP}} installed successfully" || \
30+
echo "❌ Failed to install {{.APP}}"
31+
fi
32+
1833
tools:brew:tap:
1934
desc: brew tap
2035
silent: true

shared-files/taskfile/libraries/terraform.yml

+11-8
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,17 @@ tasks:
3737
APP: '{{.ITEM}}'
3838
- task: install:module
3939

40-
# install:module:
41-
# desc: Install terraform module
42-
# cmds:
43-
# - if: IS_MODULE == "true"
44-
# then:
45-
# - terraform init
46-
# else:
47-
# - echo "This is not a terraform module"
40+
install:module:
41+
desc: Install terraform module
42+
internal: true
43+
cmds:
44+
- for: [
45+
tflint,
46+
]
47+
task: internal:tools:brew:optional
48+
vars:
49+
APP: '{{.ITEM}}'
50+
INSTALL_REQUIRED: '{{.IS_MODULE}}'
4851

4952
# * Lint
5053
lint:

shared-files/taskfile/types/terraform-module.yml.njk

-9
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
---
55
version: "3"
66

7-
vars:
8-
PROJECT_NAME: cloudavenue
9-
107
# * Import
118
includes:
129
license: ".taskfiles/license.yml"
@@ -34,9 +31,3 @@ tasks:
3431
cmds:
3532
- task: license:lint
3633
- task: tf:lint
37-
38-
generate:
39-
desc: Generate code and docs
40-
cmds:
41-
- task: go:run
42-
- task: license:run

0 commit comments

Comments
 (0)