Skip to content

Commit 69f739a

Browse files
authored
Merge branch 'main' into dependabot/github_actions/super-linter/super-linter-7.0.0
2 parents c4cf465 + 38f659f commit 69f739a

File tree

5 files changed

+49
-2
lines changed

5 files changed

+49
-2
lines changed

features/src/terraform/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [Unreleased]
1010

11+
## [1.1.0] - 2024-08-22
12+
13+
### Changed
14+
15+
- Added `tflint`
16+
1117
## [1.0.0] - 2024-05-13
1218

1319
### Changed

features/src/terraform/devcontainer-feature.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
{
22
"id": "terraform",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"name": "Terraform",
55
"documentationURL": "https://github.com/ministryofjustice/.devcontainer/tree/main/features/src/terraform",
6-
"description": "Installs the Terraform CLI",
6+
"description": "Installs the Terraform CLI and tflint",
77
"options": {
88
"terraformCliVersion": {
99
"type": "string",
1010
"description": "Version of the Terraform CLI to install",
1111
"proposals": ["latest"],
1212
"default": "latest"
13+
},
14+
"tflintVersion": {
15+
"type": "string",
16+
"description": "Version of the tflint to install",
17+
"proposals": ["latest"],
18+
"default": "latest"
1319
}
1420
},
1521
"customizations": {
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
# shellcheck source=/dev/null
6+
# file not accessible until being built
7+
source /usr/local/bin/devcontainer-utils
8+
9+
get_system_architecture
10+
11+
GITHUB_REPOSITORY="terraform-linters/tflint"
12+
VERSION="${TFLINTVERSION:-"latest"}"
13+
14+
if [[ "${VERSION}" == "latest" ]]; then
15+
get_github_latest_tag "${GITHUB_REPOSITORY}"
16+
VERSION="${GITHUB_LATEST_TAG}"
17+
VERSION_STRIP_V="${GITHUB_LATEST_TAG_STRIP_V}"
18+
else
19+
# shellcheck disable=SC2034
20+
VERSION_STRIP_V="${VERSION#v}"
21+
fi
22+
23+
curl --fail-with-body --location "https://github.com/terraform-linters/tflint/releases/download/${VERSION}/tflint_linux_${ARCHITECTURE}.zip" \
24+
--output "tflint_${VERSION_STRIP_V}_linux_${ARCHITECTURE}.zip"
25+
26+
unzip "tflint_${VERSION_STRIP_V}_linux_${ARCHITECTURE}.zip"
27+
28+
install --owner=vscode --group=vscode --mode=775 tflint /usr/local/bin/tflint
29+
30+
rm --recursive --force tflint "tflint_${VERSION_STRIP_V}_linux_${ARCHITECTURE}.zip"

features/src/terraform/install.sh

+3
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ source /usr/local/bin/devcontainer-utils
66

77
logger "info" "Installing Terraform CLI (version: ${TERRAFORMCLIVERSION})"
88
bash "$(dirname "${0}")"/install-terraform-cli.sh
9+
10+
logger "info" "Installing tflint (version: ${TFLINTVERSION})"
11+
bash "$(dirname "${0}")"/install-tflint.sh

features/test/terraform/test.sh

+2
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ source dev-container-features-test-lib
99
check "terraform version" terraform version
1010
check "terraform featurerc existence" stat /home/vscode/.devcontainer/featurerc.d/terraform-cli.sh
1111

12+
check "tflint version" tflint --version
13+
1214
reportResults

0 commit comments

Comments
 (0)