refactor: modernise RPM builder with Python tooling v2
Build / build-8 (pull_request) Successful in 8s
Build / build-9 (pull_request) Successful in 9s

- Migrate from legacy shell-based build system to modern Python tooling
- Update all metadata.yaml files to new schema with per-distro builds
- Standardise build scripts with curl -L, envsubst, and error handling
- Convert nfpm.yaml templates to use environment variable substitution
- Update Dockerfile to accept all package metadata as build arguments
- Modernise Makefile to use new Python build tool commands
- Update CI workflow to use tools/build instead of make
This commit is contained in:
2025-11-30 20:27:05 +11:00
parent b3ba980f9f
commit 182641132a
160 changed files with 2013 additions and 1089 deletions
+17 -8
View File
@@ -1,9 +1,18 @@
name: puppetdb_exporter
release: 1
version: 1.1.0
build:
- distro: el/8
image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest
- distro: el/9
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
---
arch: amd64
builds:
- image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest
release: '1'
repository: [almalinux/el8]
version: 1.1.0
- image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
release: '1'
repository: [almalinux/el9]
version: 1.1.0
description: Prometheus exporter for PuppetDB
github: camptocamp/prometheus-puppetdb-exporter
homepage: https://github.com/camptocamp/prometheus-puppetdb-exporter
license: Apache 2.0 License
maintainer: Comptocamp
name: puppetdb_exporter
platform: linux
+7 -1
View File
@@ -1,3 +1,9 @@
#!/usr/bin/bash
set -e
curl --output - -L https://github.com/camptocamp/prometheus-puppetdb-exporter/releases/download/${PACKAGE_VERSION}/prometheus-puppetdb-exporter-${PACKAGE_VERSION}.linux-amd64.tar.gz | tar --strip-components=1 -xzf -
nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm
# Process nfpm.yaml with envsubst
envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml
nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm
+7 -7
View File
@@ -1,16 +1,16 @@
# nfpm.yaml
name: puppetdb_exporter
name: ${PACKAGE_NAME}
version: ${PACKAGE_VERSION}
release: ${PACKAGE_RELEASE}
arch: amd64
platform: linux
arch: ${PACKAGE_ARCH}
platform: ${PACKAGE_PLATFORM}
section: default
priority: extra
description: "Prometheus exporter for PuppetDB"
maintainer: Comptocamp
homepage: https://github.com/camptocamp/prometheus-puppetdb-exporter
license: Apache 2.0 License
description: "${PACKAGE_DESCRIPTION}"
maintainer: ${PACKAGE_MAINTAINER}
homepage: ${PACKAGE_HOMEPAGE}
license: ${PACKAGE_LICENSE}
disable_globbing: false