feat: add terragrunt

- add makefile for all builds
- add .gitignore
- add terragrunt dockerfile/nfpm
This commit is contained in:
2024-11-23 13:52:13 +11:00
commit 63c708183b
8 changed files with 174 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
almalinux/el8
+1
View File
@@ -0,0 +1 @@
1
+35
View File
@@ -0,0 +1,35 @@
# Start with the AlmaLinux 8.10 base image
FROM git.query.consul/unkin/almalinux8: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}
ARG NFPM_VERSION
ENV NFPM_VERSION=${NFPM_VERSION}
# Clean and update the repository cache
RUN dnf clean all && \
dnf makecache
# Install build tools and dependencies for building RPMs
RUN dnf groupinstall -y 'Development Tools' && \
dnf install -y make cmake gcc gcc-c++ rpm rpmdevtools wget tar gzip
# Install nfpm using the RPM package
RUN dnf install -y https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm-${NFPM_VERSION}-1.x86_64.rpm
# Copy nfpm.yaml from the context into the container
COPY nfpm.yaml /app/nfpm.yaml
# Download the required files
RUN wget -O /app/terragrunt https://github.com/gruntwork-io/terragrunt/releases/download/v${PACKAGE_VERSION}/terragrunt_linux_amd64
# Default command to build RPMs
CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm
+35
View File
@@ -0,0 +1,35 @@
# nfpm.yaml
name: terragrunt
version: ${PACKAGE_VERSION}
release: ${PACKAGE_RELEASE}
arch: amd64
platform: linux
section: default
priority: extra
description: "Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale."
maintainer: Ben Vincent <ben@unkin.net>
homepage: https://github.com/gruntwork-io/terragrunt
license: MIT
disable_globbing: false
replaces:
- terragrunt
# Files to include in the package
contents:
- src: /app/terragrunt
dst: /usr/local/bin/terragrunt
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