From 288dfe211b920d2197307276545fe3a30b818066 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sun, 16 Nov 2025 13:24:50 +1100 Subject: [PATCH] feat: add tflint 0.59.1 - builds the tflint package --- rpms/tflint/0.59.1/release | 1 + rpms/tflint/Dockerfile | 18 ++++++++++++++++ rpms/tflint/metadata.yaml | 9 ++++++++ rpms/tflint/resources/build.sh | 10 +++++++++ rpms/tflint/resources/nfpm.yaml | 38 +++++++++++++++++++++++++++++++++ 5 files changed, 76 insertions(+) create mode 100644 rpms/tflint/0.59.1/release create mode 100644 rpms/tflint/Dockerfile create mode 100644 rpms/tflint/metadata.yaml create mode 100755 rpms/tflint/resources/build.sh create mode 100644 rpms/tflint/resources/nfpm.yaml diff --git a/rpms/tflint/0.59.1/release b/rpms/tflint/0.59.1/release new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/rpms/tflint/0.59.1/release @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/rpms/tflint/Dockerfile b/rpms/tflint/Dockerfile new file mode 100644 index 0000000..539afe6 --- /dev/null +++ b/rpms/tflint/Dockerfile @@ -0,0 +1,18 @@ +FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest + +# Create output directory for RPMs +RUN mkdir -p /app/dist + +# Set working directory +WORKDIR /app + +ARG PACKAGE_RELEASE +ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} +ARG PACKAGE_VERSION +ENV PACKAGE_VERSION=${PACKAGE_VERSION} + +# Copy resources from the context into the container +COPY resources /app/resources + +# Default command to build RPMs +CMD /app/resources/build.sh \ No newline at end of file diff --git a/rpms/tflint/metadata.yaml b/rpms/tflint/metadata.yaml new file mode 100644 index 0000000..2b40717 --- /dev/null +++ b/rpms/tflint/metadata.yaml @@ -0,0 +1,9 @@ +name: tflint +release: 1 +version: 0.59.1 +build: +- distro: el/8 + image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest +- distro: el/9 + image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +github: terraform-linters/tflint \ No newline at end of file diff --git a/rpms/tflint/resources/build.sh b/rpms/tflint/resources/build.sh new file mode 100755 index 0000000..124c455 --- /dev/null +++ b/rpms/tflint/resources/build.sh @@ -0,0 +1,10 @@ +#!/usr/bin/bash + +# Download tflint binary +wget -O /app/tflint_linux_amd64.zip https://github.com/terraform-linters/tflint/releases/download/v${PACKAGE_VERSION}/tflint_linux_amd64.zip + +# Extract the binary +unzip -j /app/tflint_linux_amd64.zip -d /app/ + +# Build the RPM +nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/tflint/resources/nfpm.yaml b/rpms/tflint/resources/nfpm.yaml new file mode 100644 index 0000000..a3cf545 --- /dev/null +++ b/rpms/tflint/resources/nfpm.yaml @@ -0,0 +1,38 @@ +# nfpm.yaml + +name: tflint +version: ${PACKAGE_VERSION} +release: ${PACKAGE_RELEASE} +arch: amd64 +platform: linux +section: default +priority: extra +description: "A Pluggable Terraform Linter that finds potential errors in Terraform configurations and enforces best practices." + +maintainer: Terraform Linters +homepage: https://github.com/terraform-linters/tflint +license: MPL-2.0 + +disable_globbing: false + +replaces: + - tflint + +provides: + - tflint + +# Files to include in the package +contents: + - src: /app/tflint + dst: /usr/bin/tflint + file_info: + mode: 0755 + owner: root + group: root + +# Scripts to run during installation/removal (optional) +# scripts: +# preinstall: ./scripts/preinstall.sh +# postinstall: ./scripts/postinstall.sh +# preremove: ./scripts/preremove.sh +# postremove: ./scripts/postremove.sh \ No newline at end of file