-
Notifications
You must be signed in to change notification settings - Fork 0
Chore: [AEA-0000] - add tflint to eps-storage-terraform #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
440d220
f5d589c
a38b6cd
a1f4631
4e9d982
a9193c1
636d055
0877192
4fc4b74
55d554e
4098d86
f304a05
3306be3
567bfe2
1c1a353
c46f3b2
11f14ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -43,7 +43,7 @@ build-node-24-python-3-14-image: | |||||||||||||||||||||
| CONTAINER_NAME=node_24_python_3_14 BASE_VERSION_TAG=local-build BASE_FOLDER=languages IMAGE_TAG=local-build $(MAKE) build-image | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| build-eps-storage-terraform-image: | ||||||||||||||||||||||
| CONTAINER_NAME=eps_storage_terraform BASE_VERSION_TAG=local-build BASE_FOLDER=projects IMAGE_TAG=local-build $(MAKE) build-image | ||||||||||||||||||||||
| CONTAINER_NAME=eps-storage-terraform BASE_VERSION_TAG=local-build BASE_FOLDER=projects IMAGE_TAG=local-build $(MAKE) build-image | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| build-eps-data-extract-image: | ||||||||||||||||||||||
| CONTAINER_NAME=eps_data_extract BASE_VERSION_TAG=local-build BASE_FOLDER=projects IMAGE_TAG=local-build $(MAKE) build-image | ||||||||||||||||||||||
|
|
@@ -72,7 +72,14 @@ build-grype: | |||||||||||||||||||||
| build-grant: | ||||||||||||||||||||||
| docker build -f src/base/.devcontainer/Dockerfile.grant --tag local_grant:latest src/base/.devcontainer/ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| build-image: build-syft build-grype build-grant guard-CONTAINER_NAME guard-BASE_VERSION_TAG guard-BASE_FOLDER guard-IMAGE_TAG | ||||||||||||||||||||||
| build-tflint: | ||||||||||||||||||||||
| docker buildx build \ | ||||||||||||||||||||||
| --secret id=GH_TOKEN,env=GITHUB_TOKEN \ | ||||||||||||||||||||||
| -f src/projects/eps-storage-terraform/.devcontainer/Dockerfile.tflint \ | ||||||||||||||||||||||
| --tag local_tflint:latest \ | ||||||||||||||||||||||
| src/projects/eps-storage-terraform/.devcontainer/ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| build-image: build-syft build-grype build-grant build-tflint guard-CONTAINER_NAME guard-BASE_VERSION_TAG guard-BASE_FOLDER guard-IMAGE_TAG | ||||||||||||||||||||||
|
||||||||||||||||||||||
| build-image: build-syft build-grype build-grant build-tflint guard-CONTAINER_NAME guard-BASE_VERSION_TAG guard-BASE_FOLDER guard-IMAGE_TAG | |
| build-image: build-syft build-grype build-grant guard-CONTAINER_NAME guard-BASE_VERSION_TAG guard-BASE_FOLDER guard-IMAGE_TAG | |
| if [ "$${CONTAINER_NAME}" = "eps_storage_terraform" ]; then \ | |
| $(MAKE) build-tflint; \ | |
| fi; \ |
Copilot
AI
Apr 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build-image now always depends on build-tflint, which requires a GitHub token secret to be present and pulls/builds an extra image even when building unrelated containers (e.g., base, node_24_*). This makes local builds and CI builds for other images fail or do unnecessary work. Consider only building local_tflint when the target container actually needs it (e.g., conditionally in the eps-storage-terraform build, or by making the Dockerfile fall back when local_tflint is absent).
| build-image: build-syft build-grype build-grant build-tflint guard-CONTAINER_NAME guard-BASE_VERSION_TAG guard-BASE_FOLDER guard-IMAGE_TAG | |
| build-image: build-syft build-grype build-grant guard-CONTAINER_NAME guard-BASE_VERSION_TAG guard-BASE_FOLDER guard-IMAGE_TAG | |
| if [ "$${CONTAINER_NAME}" = "eps_storage_terraform" ]; then \ | |
| $(MAKE) build-tflint; \ | |
| fi; \ |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,13 @@ | ||||||||||
| FROM serversideup/github-cli:2.89.0 AS build | ||||||||||
| ARG TARGETARCH | ||||||||||
| ARG TFLINT_VERSION="v0.61.0" | ||||||||||
| COPY --chmod=755 scripts/install_tflint.sh /tmp/install_tflint.sh | ||||||||||
| RUN --mount=type=secret,id=GH_TOKEN,env=GH_TOKEN \ | ||||||||||
| INSTALL_DIR=/tmp/tflint/ \ | ||||||||||
| ARCH="${TARGETARCH}" \ | ||||||||||
| VERSION="${TFLINT_VERSION}" \ | ||||||||||
|
Comment on lines
+7
to
+8
|
||||||||||
| ARCH="${TARGETARCH}" \ | |
| VERSION="${TFLINT_VERSION}" \ | |
| TARGETARCH="${TARGETARCH}" \ | |
| TFLINT_VERSION="${TFLINT_VERSION}" \ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -euo pipefail | ||
| export DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| DEFAULT_INSTALL_DIR="/usr/local/bin" | ||
| INSTALL_DIR="${INSTALL_DIR:-$DEFAULT_INSTALL_DIR}" | ||
|
|
||
| case "${TARGETARCH:-}" in | ||
| amd64|arm64) | ||
| TFLINT_ARCH="${TARGETARCH}" | ||
| ;; | ||
| *) | ||
| echo "Unsupported or missing TARGETARCH: '${TARGETARCH:-}'" | ||
| echo "Expected one of: amd64, arm64" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
|
|
||
| if ! command -v curl >/dev/null 2>&1 || ! command -v unzip >/dev/null 2>&1; then | ||
| apt-get update | ||
| apt-get install -y --no-install-recommends curl unzip ca-certificates | ||
| fi | ||
|
|
||
| if ! command -v gh >/dev/null 2>&1; then | ||
| echo "GitHub CLI (gh) is required for attestation verification but was not found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| TFLINT_URL="https://github.com/terraform-linters/tflint/releases/download/${TFLINT_VERSION}/tflint_linux_${TFLINT_ARCH}.zip" | ||
| TFLINT_ASSET_NAME="tflint_linux_${TFLINT_ARCH}.zip" | ||
| CHECKSUMS_URL="https://github.com/terraform-linters/tflint/releases/download/${TFLINT_VERSION}/checksums.txt" | ||
| tmp_dir="$(mktemp -d)" | ||
|
Comment on lines
+30
to
+33
|
||
| trap 'rm -rf "${tmp_dir}"' EXIT | ||
|
|
||
| curl -fsSL "${CHECKSUMS_URL}" -o "${tmp_dir}/checksums.txt" | ||
| gh attestation verify "${tmp_dir}/checksums.txt" -R terraform-linters/tflint | ||
|
|
||
| curl -fsSL "${TFLINT_URL}" -o "${tmp_dir}/${TFLINT_ASSET_NAME}" | ||
| ( | ||
| cd "${tmp_dir}" | ||
| sha256sum --ignore-missing -c checksums.txt | ||
| ) | ||
|
|
||
| unzip -q "${tmp_dir}/${TFLINT_ASSET_NAME}" -d "${tmp_dir}" | ||
|
|
||
| mkdir -p "$INSTALL_DIR" | ||
| install -m 0755 "$tmp_dir/tflint" "${INSTALL_DIR}/tflint" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
| set -euo pipefail | ||
|
|
||
| # clean up | ||
| apt-get clean | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This uses
docker buildx buildto taglocal_tflint:latest, but without--load(or an explicit--output type=docker). With the commondocker-containerbuildx driver (e.g., in GitHub Actions), the tagged image won't be loaded into the local Docker daemon, so subsequentdevcontainer buildsteps that doFROM local_tflint:latestwill fail to resolve the image. Add--load(single-platform) or change the approach to export the binary via--outputand copy it in.