From 182641132ad46610fa9b05d883a69f0b9addcdb5 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sun, 30 Nov 2025 20:27:05 +1100 Subject: [PATCH] refactor: modernise RPM builder with Python tooling v2 - 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 --- .gitea/workflows/build.yaml | 4 +- Dockerfile | 19 +- Makefile | 44 +- rpms/act_runner/metadata.yaml | 24 +- rpms/act_runner/resources/build.sh | 11 +- rpms/act_runner/resources/nfpm.yaml | 14 +- rpms/bind_exporter/metadata.yaml | 24 +- rpms/bind_exporter/resources/build.sh | 6 +- rpms/bind_exporter/resources/nfpm.yaml | 14 +- rpms/boilerplate/metadata.yaml | 25 +- rpms/boilerplate/resources/build.sh | 6 +- rpms/boilerplate/resources/nfpm.yaml | 14 +- rpms/cni-plugins/metadata.yaml | 25 +- rpms/cni-plugins/resources/build.sh | 6 +- rpms/cni-plugins/resources/nfpm.yaml | 14 +- rpms/consul-cni/metadata.yaml | 24 +- rpms/consul-cni/resources/build.sh | 10 +- rpms/consul-cni/resources/nfpm.yaml | 14 +- rpms/consul/metadata.yaml | 24 +- rpms/consul/resources/build.sh | 9 +- rpms/consul/resources/nfpm.yaml | 14 +- rpms/etcd/metadata.yaml | 25 +- rpms/etcd/resources/build.sh | 6 +- rpms/etcd/resources/nfpm.yaml | 14 +- rpms/exportarr/metadata.yaml | 24 +- rpms/exportarr/resources/build.sh | 6 +- rpms/exportarr/resources/nfpm.yaml | 14 +- rpms/frr_exporter/metadata.yaml | 25 +- rpms/frr_exporter/resources/build.sh | 8 +- rpms/frr_exporter/resources/nfpm.yaml | 14 +- rpms/g10k/metadata.yaml | 25 +- rpms/g10k/resources/build.sh | 6 +- rpms/g10k/resources/nfpm.yaml | 14 +- rpms/helmfile/metadata.yaml | 25 +- rpms/helmfile/resources/build.sh | 8 +- rpms/helmfile/resources/nfpm.yaml | 14 +- rpms/incus/metadata.yaml | 20 +- rpms/incus/resources/build.sh | 8 +- rpms/incus/resources/nfpm_incus.yaml | 8 +- rpms/jellyfin-ffmpeg-bin/metadata.yaml | 19 +- rpms/jellyfin-server/metadata.yaml | 19 +- rpms/jellyfin-web/metadata.yaml | 19 +- rpms/jsonnet-language-server/metadata.yaml | 25 +- .../resources/build.sh | 8 +- .../resources/nfpm.yaml | 14 +- rpms/jsonnet-lint/metadata.yaml | 25 +- rpms/jsonnet-lint/resources/build.sh | 6 +- rpms/jsonnet-lint/resources/nfpm.yaml | 14 +- rpms/jsonnet/metadata.yaml | 25 +- rpms/jsonnet/resources/build.sh | 6 +- rpms/jsonnet/resources/nfpm.yaml | 14 +- rpms/libfoundationdb/metadata.yaml | 25 +- rpms/libfoundationdb/resources/build.sh | 8 +- rpms/libfoundationdb/resources/nfpm.yaml | 14 +- rpms/nfpm/metadata.yaml | 25 +- rpms/nfpm/resources/build.sh | 6 +- rpms/nfpm/resources/nfpm.yaml | 14 +- rpms/node_exporter/metadata.yaml | 24 +- rpms/node_exporter/resources/build.sh | 7 +- rpms/node_exporter/resources/nfpm.yaml | 14 +- rpms/nomad-autoscaler/metadata.yaml | 24 +- rpms/nomad-autoscaler/resources/build.sh | 10 +- rpms/nomad-autoscaler/resources/nfpm.yaml | 14 +- rpms/nomad/metadata.yaml | 24 +- rpms/nomad/resources/build.sh | 10 +- rpms/nomad/resources/nfpm.yaml | 14 +- rpms/nzbget/metadata.yaml | 25 +- rpms/nzbget/resources/build.sh | 4 +- rpms/nzbget/resources/nfpm.yaml | 14 +- rpms/nzbget_exporter/metadata.yaml | 25 +- rpms/nzbget_exporter/resources/build.sh | 8 +- rpms/nzbget_exporter/resources/nfpm.yaml | 14 +- .../metadata.yaml | 25 +- .../resources/build.sh | 8 +- .../resources/nfpm.yaml | 14 +- .../openbao-plugin-secret-nomad/metadata.yaml | 25 +- .../resources/build.sh | 8 +- .../resources/nfpm.yaml | 14 +- rpms/openbao-plugins/metadata.yaml | 25 +- rpms/openbao-plugins/resources/build.sh | 7 +- rpms/openbao-plugins/resources/nfpm.yaml | 14 +- rpms/packer/metadata.yaml | 24 +- rpms/packer/resources/build.sh | 9 +- rpms/packer/resources/nfpm.yaml | 14 +- rpms/pgbouncer_exporter/metadata.yaml | 24 +- rpms/pgbouncer_exporter/resources/build.sh | 6 +- rpms/pgbouncer_exporter/resources/nfpm.yaml | 14 +- rpms/postgres_exporter/metadata.yaml | 24 +- rpms/postgres_exporter/resources/build.sh | 6 +- rpms/postgres_exporter/resources/nfpm.yaml | 14 +- rpms/puppet-initial/metadata.yaml | 23 +- rpms/puppet-initial/resources/build.sh | 7 +- rpms/puppet-initial/resources/nfpm.yaml | 12 +- rpms/puppetdb_exporter/metadata.yaml | 25 +- rpms/puppetdb_exporter/resources/build.sh | 8 +- rpms/puppetdb_exporter/resources/nfpm.yaml | 14 +- rpms/ruff/metadata.yaml | 25 +- rpms/ruff/resources/build.sh | 7 +- rpms/ruff/resources/nfpm.yaml | 14 +- rpms/stalwart-cli/metadata.yaml | 25 +- rpms/stalwart-cli/resources/build.sh | 8 +- rpms/stalwart-cli/resources/nfpm.yaml | 14 +- rpms/stalwart-foundationdb/metadata.yaml | 25 +- rpms/stalwart-foundationdb/resources/build.sh | 8 +- .../stalwart-foundationdb/resources/nfpm.yaml | 14 +- rpms/stalwart/metadata.yaml | 25 +- rpms/stalwart/resources/build.sh | 8 +- rpms/stalwart/resources/nfpm.yaml | 14 +- rpms/terraform/metadata.yaml | 24 +- rpms/terraform/resources/build.sh | 9 +- rpms/terraform/resources/nfpm.yaml | 14 +- rpms/terragrunt/metadata.yaml | 25 +- rpms/terragrunt/resources/build.sh | 7 +- rpms/terragrunt/resources/nfpm.yaml | 14 +- rpms/tflint/metadata.yaml | 25 +- rpms/tflint/resources/build.sh | 6 +- rpms/tflint/resources/nfpm.yaml | 14 +- rpms/unkin-ca-certificates/metadata.yaml | 24 +- rpms/unkin-ca-certificates/resources/build.sh | 12 +- .../unkin-ca-certificates/resources/nfpm.yaml | 14 +- rpms/unkin-undionly-kpxe/metadata.yaml | 24 +- rpms/unkin-undionly-kpxe/resources/build.sh | 7 +- rpms/unkin-undionly-kpxe/resources/nfpm.yaml | 14 +- rpms/unrar/metadata.yaml | 24 +- rpms/unrar/resources/build.sh | 10 +- rpms/unrar/resources/nfpm.yaml | 14 +- rpms/uv/metadata.yaml | 25 +- rpms/uv/resources/build.sh | 7 +- rpms/uv/resources/nfpm.yaml | 14 +- rpms/vals/metadata.yaml | 25 +- rpms/vals/resources/build.sh | 8 +- rpms/vals/resources/nfpm.yaml | 12 +- rpms/vault/metadata.yaml | 24 +- rpms/vault/resources/build.sh | 9 +- rpms/vault/resources/nfpm.yaml | 14 +- rpms/victoria-logs/metadata.yaml | 25 +- rpms/victoria-logs/resources/build.sh | 10 +- rpms/victoria-logs/resources/nfpm.yaml | 14 +- rpms/vlutils/metadata.yaml | 25 +- rpms/vlutils/resources/build.sh | 10 +- rpms/vlutils/resources/nfpm.yaml | 14 +- rpms/vmagent/metadata.yaml | 25 +- rpms/vmagent/resources/build.sh | 9 +- rpms/vmagent/resources/nfpm.yaml | 14 +- rpms/vmalert/metadata.yaml | 25 +- rpms/vmalert/resources/build.sh | 9 +- rpms/vmalert/resources/nfpm.yaml | 14 +- rpms/vminsert/metadata.yaml | 25 +- rpms/vminsert/resources/build.sh | 9 +- rpms/vminsert/resources/nfpm.yaml | 14 +- rpms/vmselect/metadata.yaml | 25 +- rpms/vmselect/resources/build.sh | 13 +- rpms/vmselect/resources/nfpm.yaml | 14 +- rpms/vmstorage/metadata.yaml | 25 +- rpms/vmstorage/resources/build.sh | 9 +- rpms/vmstorage/resources/nfpm.yaml | 14 +- rpms/vmutils/metadata.yaml | 25 +- rpms/vmutils/resources/build.sh | 10 +- rpms/vmutils/resources/nfpm.yaml | 14 +- tools/build | 615 ++++++++++++------ 160 files changed, 2013 insertions(+), 1089 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 509f1d4..d09960b 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -20,7 +20,7 @@ jobs: env: VAULT_ROLE_ID: ${{ secrets.RPMBUILDER_VAULT_ROLEID }} run: | - make all DISTRO=el/8 + ./tools/build build-all --distro almalinux/el8 - name: Show RPMs run: | @@ -46,7 +46,7 @@ jobs: env: VAULT_ROLE_ID: ${{ secrets.RPMBUILDER_VAULT_ROLEID }} run: | - make all DISTRO=el/9 + ./tools/build build-all --distro almalinux/el9 - name: Show RPMs run: | diff --git a/Dockerfile b/Dockerfile index acacc0f..47d0867 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,10 +7,25 @@ RUN mkdir -p /app/dist # Set working directory WORKDIR /app -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} +# Accept all package metadata as build arguments and set as environment variables +ARG PACKAGE_NAME +ENV PACKAGE_NAME=${PACKAGE_NAME} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} +ARG PACKAGE_RELEASE +ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} +ARG PACKAGE_DESCRIPTION +ENV PACKAGE_DESCRIPTION=${PACKAGE_DESCRIPTION} +ARG PACKAGE_MAINTAINER +ENV PACKAGE_MAINTAINER=${PACKAGE_MAINTAINER} +ARG PACKAGE_HOMEPAGE +ENV PACKAGE_HOMEPAGE=${PACKAGE_HOMEPAGE} +ARG PACKAGE_LICENSE +ENV PACKAGE_LICENSE=${PACKAGE_LICENSE} +ARG PACKAGE_ARCH +ENV PACKAGE_ARCH=${PACKAGE_ARCH} +ARG PACKAGE_PLATFORM +ENV PACKAGE_PLATFORM=${PACKAGE_PLATFORM} # Copy resources from the context into the container COPY resources /app/resources diff --git a/Makefile b/Makefile index ff02ba4..8c56409 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # Variables ROOT_DIR := $(PWD) BUILD_TOOL := $(ROOT_DIR)/tools/build -DISTRO ?= el/9 # Default to el/9 if not specified +DISTRO ?= almalinux/el9 # Automatically find all packages with metadata.yaml PACKAGES := $(shell find $(ROOT_DIR)/rpms -mindepth 1 -maxdepth 1 -type d -exec test -f {}/metadata.yaml \; -print | xargs -n1 basename | sort) @@ -20,33 +20,18 @@ list: # Build all packages using Python tool build-all: @echo "Building all packages using Python tooling for distro $(DISTRO)..." - $(BUILD_TOOL) --all --distro $(DISTRO) + $(BUILD_TOOL) build-all --distro $(DISTRO) # Build specific package using Python tool .PHONY: $(PACKAGES) $(PACKAGES): @echo "Building package: $@ for distro $(DISTRO)" - $(BUILD_TOOL) --package $@ --distro $(DISTRO) - -# Build specific package with version/release override -build: - @if [ -z "$(PACKAGE_NAME)" ]; then \ - echo "Error: PACKAGE_NAME not specified"; \ - echo "Usage: make build PACKAGE_NAME=package [PACKAGE_VERSION=version] [PACKAGE_RELEASE=release]"; \ - exit 1; \ - fi - @if [ -n "$(PACKAGE_VERSION)" ] && [ -n "$(PACKAGE_RELEASE)" ]; then \ - echo "Building $(PACKAGE_NAME) with explicit version $(PACKAGE_VERSION)-$(PACKAGE_RELEASE) for distro $(DISTRO)"; \ - $(BUILD_TOOL) --package $(PACKAGE_NAME) --version $(PACKAGE_VERSION) --release $(PACKAGE_RELEASE) --distro $(DISTRO); \ - else \ - echo "Building $(PACKAGE_NAME) using metadata.yaml for distro $(DISTRO)"; \ - $(BUILD_TOOL) --package $(PACKAGE_NAME) --distro $(DISTRO); \ - fi + $(BUILD_TOOL) build --distro $(DISTRO) $@ # Dry run - show what would be built without building dry-run: @echo "Dry run - showing what would be built for distro $(DISTRO):" - $(BUILD_TOOL) --all --distro $(DISTRO) --dry-run + $(BUILD_TOOL) build-all --distro $(DISTRO) --dry-run # Clean target clean: @@ -62,24 +47,3 @@ update: update-%: @echo "Checking for updates for package: $*" $(ROOT_DIR)/tools/update-gh --package $* - -# Help target -help: - @echo "Available targets:" - @echo " all - Build all packages (default)" - @echo " list - List all available packages" - @echo " build-all - Build all packages using Python tooling" - @echo " - Build specific package (e.g., 'make consul')" - @echo " build - Build with explicit PACKAGE_NAME, PACKAGE_VERSION, PACKAGE_RELEASE" - @echo " dry-run - Show what would be built without building" - @echo " clean - Remove build artifacts" - @echo " update - Check all packages for GitHub release updates" - @echo " update- - Check specific package for GitHub release updates" - @echo " help - Show this help message" - @echo "" - @echo "Examples:" - @echo " make consul # Build consul using metadata.yaml" - @echo " make build PACKAGE_NAME=consul # Build consul using metadata.yaml" - @echo " make build PACKAGE_NAME=consul PACKAGE_VERSION=1.21.1 PACKAGE_RELEASE=1" - @echo " make update-consul # Check consul for GitHub updates" - @echo " make dry-run # Show what would be built" diff --git a/rpms/act_runner/metadata.yaml b/rpms/act_runner/metadata.yaml index 148c3dd..d44390e 100644 --- a/rpms/act_runner/metadata.yaml +++ b/rpms/act_runner/metadata.yaml @@ -1,8 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 0.2.12 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.2.12 +description: A runner for Gitea based on act. +github: unknown/act_runner +homepage: https://gitea.com/gitea/act_runner +license: MIT +maintainer: Gitea name: act_runner -release: 1 -version: 0.2.12 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +platform: linux diff --git a/rpms/act_runner/resources/build.sh b/rpms/act_runner/resources/build.sh index b9a3382..0a0aec8 100755 --- a/rpms/act_runner/resources/build.sh +++ b/rpms/act_runner/resources/build.sh @@ -1,3 +1,10 @@ #!/usr/bin/bash -curl --output act_runner-linux-amd64 https://dl.gitea.com/act_runner/${PACKAGE_VERSION}/act_runner-${PACKAGE_VERSION}-linux-amd64 -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm + +set -e + +curl -L --output act_runner-linux-amd64 https://dl.gitea.com/act_runner/${PACKAGE_VERSION}/act_runner-${PACKAGE_VERSION}-linux-amd64 + +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm diff --git a/rpms/act_runner/resources/nfpm.yaml b/rpms/act_runner/resources/nfpm.yaml index fa2a81e..70b956f 100644 --- a/rpms/act_runner/resources/nfpm.yaml +++ b/rpms/act_runner/resources/nfpm.yaml @@ -1,16 +1,16 @@ # nfpm.yaml -name: act_runner +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "A runner for Gitea based on act." -maintainer: Gitea -homepage: https://gitea.com/gitea/act_runner -license: MIT +description: "${PACKAGE_DESCRIPTION}" +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/bind_exporter/metadata.yaml b/rpms/bind_exporter/metadata.yaml index 16dac06..c9c3dff 100644 --- a/rpms/bind_exporter/metadata.yaml +++ b/rpms/bind_exporter/metadata.yaml @@ -1,8 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 0.8.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.8.0 +description: Prometheus exporter for BIND +github: prometheus-community/bind_exporter +homepage: https://github.com/prometheus-community/bind_exporter +license: Apache-2.0 license +maintainer: Prometheus name: bind_exporter -release: 1 -version: 0.8.0 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +platform: linux diff --git a/rpms/bind_exporter/resources/build.sh b/rpms/bind_exporter/resources/build.sh index c7400d7..d03a7f6 100755 --- a/rpms/bind_exporter/resources/build.sh +++ b/rpms/bind_exporter/resources/build.sh @@ -1,6 +1,10 @@ #!/usr/bin/bash +set -e # Download the required files curl --output - -L https://github.com/prometheus-community/bind_exporter/releases/download/v${PACKAGE_VERSION}/bind_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 diff --git a/rpms/bind_exporter/resources/nfpm.yaml b/rpms/bind_exporter/resources/nfpm.yaml index 077d8f6..a83589b 100644 --- a/rpms/bind_exporter/resources/nfpm.yaml +++ b/rpms/bind_exporter/resources/nfpm.yaml @@ -1,16 +1,16 @@ # nfpm.yaml -name: bind_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 BIND" -maintainer: Prometheus -homepage: https://github.com/prometheus-community/bind_exporter -license: Apache-2.0 license +description: "${PACKAGE_DESCRIPTION}" +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/boilerplate/metadata.yaml b/rpms/boilerplate/metadata.yaml index fd1549c..439cbd6 100644 --- a/rpms/boilerplate/metadata.yaml +++ b/rpms/boilerplate/metadata.yaml @@ -1,9 +1,18 @@ -name: boilerplate -release: 1 -version: 0.6.1 -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: 0.6.1 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.6.1 +description: Boilerplate is a tool for generating files and folders (boilerplate) from a set of templates. github: gruntwork-io/boilerplate +homepage: https://github.com/gruntwork-io/boilerplate +license: MIT +maintainer: Gruntwork +name: boilerplate +platform: linux diff --git a/rpms/boilerplate/resources/build.sh b/rpms/boilerplate/resources/build.sh index 6c76db7..21f736a 100755 --- a/rpms/boilerplate/resources/build.sh +++ b/rpms/boilerplate/resources/build.sh @@ -1,7 +1,11 @@ #!/usr/bin/bash +set -e # Download the required files wget -O /app/boilerplate https://github.com/gruntwork-io/boilerplate/releases/download/v${PACKAGE_VERSION}/boilerplate_linux_amd64 +# Process nfpm.yaml with envsubst +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + # Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/boilerplate/resources/nfpm.yaml b/rpms/boilerplate/resources/nfpm.yaml index 5a947f1..b27a382 100644 --- a/rpms/boilerplate/resources/nfpm.yaml +++ b/rpms/boilerplate/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: boilerplate +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "Boilerplate is a tool for generating files and folders (boilerplate) from a set of templates." +description: "${PACKAGE_DESCRIPTION}" -maintainer: Gruntwork -homepage: https://github.com/gruntwork-io/boilerplate -license: MIT +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/cni-plugins/metadata.yaml b/rpms/cni-plugins/metadata.yaml index 283eae5..6117c0e 100644 --- a/rpms/cni-plugins/metadata.yaml +++ b/rpms/cni-plugins/metadata.yaml @@ -1,9 +1,18 @@ -name: cni-plugins -release: 1 -version: 1.7.1 -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.7.1 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.7.1 +description: Some reference and example networking plugins, maintained by the CNI team. github: containernetworking/plugins +homepage: https://github.com/containernetworking/plugins +license: Apache-2.0 +maintainer: ContainerNetworking +name: cni-plugins +platform: linux diff --git a/rpms/cni-plugins/resources/build.sh b/rpms/cni-plugins/resources/build.sh index f89d051..364b9fd 100755 --- a/rpms/cni-plugins/resources/build.sh +++ b/rpms/cni-plugins/resources/build.sh @@ -1,8 +1,12 @@ #!/usr/bin/bash +set -e # Download and extract cni-plugins wget -O /app/cni-plugins-linux-amd64.tgz https://github.com/containernetworking/plugins/releases/download/v${PACKAGE_VERSION}/cni-plugins-linux-amd64-v${PACKAGE_VERSION}.tgz tar xf cni-plugins-linux-amd64.tgz +# Process nfpm.yaml with envsubst +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + # Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/cni-plugins/resources/nfpm.yaml b/rpms/cni-plugins/resources/nfpm.yaml index 6b58b09..91ba0fe 100644 --- a/rpms/cni-plugins/resources/nfpm.yaml +++ b/rpms/cni-plugins/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: cni-plugins +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "Some reference and example networking plugins, maintained by the CNI team." +description: "${PACKAGE_DESCRIPTION}" -maintainer: ContainerNetworking -homepage: https://github.com/containernetworking/plugins -license: Apache-2.0 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/consul-cni/metadata.yaml b/rpms/consul-cni/metadata.yaml index 0320a13..c251a58 100644 --- a/rpms/consul-cni/metadata.yaml +++ b/rpms/consul-cni/metadata.yaml @@ -1,8 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 1.7.1 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.7.1 +description: Plugin for Consul on Kubernetes to allow configuring traffic redirection rules without escalated container privileges. +github: unknown/consul-cni +homepage: https://hashicorp.com +license: Mozilla Public License, version 2.0 +maintainer: Hashicorp name: consul-cni -release: 1 -version: 1.7.1 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +platform: linux diff --git a/rpms/consul-cni/resources/build.sh b/rpms/consul-cni/resources/build.sh index bd9c870..a5f358e 100755 --- a/rpms/consul-cni/resources/build.sh +++ b/rpms/consul-cni/resources/build.sh @@ -1,11 +1,15 @@ #!/usr/bin/bash +set -e + # Install dependencies dnf install -y unzip # Download and extract consul-cni -curl -o /app/consul-cni.zip https://releases.hashicorp.com/consul-cni/${PACKAGE_VERSION}/consul-cni_${PACKAGE_VERSION}_linux_amd64.zip +curl -L -o /app/consul-cni.zip https://releases.hashicorp.com/consul-cni/${PACKAGE_VERSION}/consul-cni_${PACKAGE_VERSION}_linux_amd64.zip unzip consul-cni.zip -# Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/consul-cni/resources/nfpm.yaml b/rpms/consul-cni/resources/nfpm.yaml index 00ba7fe..9ab9a0f 100644 --- a/rpms/consul-cni/resources/nfpm.yaml +++ b/rpms/consul-cni/resources/nfpm.yaml @@ -1,16 +1,16 @@ # nfpm.yaml -name: consul-cni +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "Plugin for Consul on Kubernetes to allow configuring traffic redirection rules without escalated container privileges." -maintainer: Hashicorp -homepage: https://hashicorp.com -license: Mozilla Public License, version 2.0 +description: "${PACKAGE_DESCRIPTION}" +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/consul/metadata.yaml b/rpms/consul/metadata.yaml index b5bd29d..2f4e73d 100644 --- a/rpms/consul/metadata.yaml +++ b/rpms/consul/metadata.yaml @@ -1,8 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 1.21.1 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.21.1 +description: Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure. +github: hashicorp/consul +homepage: https://github.com/hashicorp/consul +license: BUSL-1.1 +maintainer: HashiCorp name: consul -release: 1 -version: 1.21.1 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +platform: linux diff --git a/rpms/consul/resources/build.sh b/rpms/consul/resources/build.sh index 1e98c07..9db6806 100755 --- a/rpms/consul/resources/build.sh +++ b/rpms/consul/resources/build.sh @@ -1,11 +1,16 @@ #!/usr/bin/bash +set -e + # Install dependencies dnf install -y unzip # Download and extract consul -curl -o /app/consul.zip https://releases.hashicorp.com/consul/${PACKAGE_VERSION}/consul_${PACKAGE_VERSION}_linux_amd64.zip +curl -L -o /app/consul.zip https://releases.hashicorp.com/consul/${PACKAGE_VERSION}/consul_${PACKAGE_VERSION}_linux_amd64.zip unzip consul.zip +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + # Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/consul/resources/nfpm.yaml b/rpms/consul/resources/nfpm.yaml index 9b18e87..6939bd7 100644 --- a/rpms/consul/resources/nfpm.yaml +++ b/rpms/consul/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: consul +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure." +description: "${PACKAGE_DESCRIPTION}" -maintainer: HashiCorp -homepage: https://github.com/hashicorp/consul -license: BUSL-1.1 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/etcd/metadata.yaml b/rpms/etcd/metadata.yaml index 3948d0f..35aa5e6 100644 --- a/rpms/etcd/metadata.yaml +++ b/rpms/etcd/metadata.yaml @@ -1,9 +1,18 @@ -name: etcd -release: 2 -version: 3.5.18 -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: '2' + repository: [almalinux/el8] + version: 3.5.18 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '2' + repository: [almalinux/el9] + version: 3.5.18 +description: A distributed, reliable key-value store for the most critical data of a distributed system. github: etcd-io/etcd +homepage: https://etcd.io/ +license: Apache-2.0 +maintainer: https://etcd.io/ +name: etcd +platform: linux diff --git a/rpms/etcd/resources/build.sh b/rpms/etcd/resources/build.sh index 41a6178..7fc0fd4 100755 --- a/rpms/etcd/resources/build.sh +++ b/rpms/etcd/resources/build.sh @@ -1,9 +1,13 @@ #!/usr/bin/bash +set -e # Download and extract etcd wget -O /app/etcd-v${PACKAGE_VERSION}-linux-amd64.tar.gz https://github.com/etcd-io/etcd/releases/download/v${PACKAGE_VERSION}/etcd-v${PACKAGE_VERSION}-linux-amd64.tar.gz tar xf /app/etcd-v${PACKAGE_VERSION}-linux-amd64.tar.gz mv /app/etcd-v${PACKAGE_VERSION}-linux-amd64/* /app/ +# Process nfpm.yaml with envsubst +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + # Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/etcd/resources/nfpm.yaml b/rpms/etcd/resources/nfpm.yaml index b2eb14d..1a727db 100644 --- a/rpms/etcd/resources/nfpm.yaml +++ b/rpms/etcd/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: etcd +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "A distributed, reliable key-value store for the most critical data of a distributed system." +description: "${PACKAGE_DESCRIPTION}" -maintainer: https://etcd.io/ -homepage: https://etcd.io/ -license: Apache-2.0 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/exportarr/metadata.yaml b/rpms/exportarr/metadata.yaml index 23f95d7..84f90f6 100644 --- a/rpms/exportarr/metadata.yaml +++ b/rpms/exportarr/metadata.yaml @@ -1,8 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 2.2.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 2.2.0 +description: AIO Prometheus Exporter for Sabnzbd, Bazarr, Prowlarr, Lidarr, Readarr, Radarr, and Sonarr +github: onedr0p/exportarr +homepage: https://github.com/onedr0p/exportarr +license: MIT license +maintainer: onedr0p name: exportarr -release: 1 -version: 2.2.0 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +platform: linux diff --git a/rpms/exportarr/resources/build.sh b/rpms/exportarr/resources/build.sh index 4d80f3a..78e3ea3 100755 --- a/rpms/exportarr/resources/build.sh +++ b/rpms/exportarr/resources/build.sh @@ -1,6 +1,10 @@ #!/usr/bin/bash +set -e # Download the required files curl --output - -L https://github.com/onedr0p/exportarr/releases/download/v${PACKAGE_VERSION}/exportarr_${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 diff --git a/rpms/exportarr/resources/nfpm.yaml b/rpms/exportarr/resources/nfpm.yaml index 2703d7c..535876e 100644 --- a/rpms/exportarr/resources/nfpm.yaml +++ b/rpms/exportarr/resources/nfpm.yaml @@ -1,16 +1,16 @@ # nfpm.yaml -name: exportarr +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "AIO Prometheus Exporter for Sabnzbd, Bazarr, Prowlarr, Lidarr, Readarr, Radarr, and Sonarr" -maintainer: onedr0p -homepage: https://github.com/onedr0p/exportarr -license: MIT license +description: "${PACKAGE_DESCRIPTION}" +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/frr_exporter/metadata.yaml b/rpms/frr_exporter/metadata.yaml index 4b13ad9..068947e 100644 --- a/rpms/frr_exporter/metadata.yaml +++ b/rpms/frr_exporter/metadata.yaml @@ -1,9 +1,18 @@ -name: frr_exporter -release: 1 -version: 1.8.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.8.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.8.0 +description: Prometheus exporter for Free Range Routing github: tynany/frr_exporter +homepage: https://github.com/tynany/frr_exporter +license: MIT +maintainer: Prometheus +name: frr_exporter +platform: linux diff --git a/rpms/frr_exporter/resources/build.sh b/rpms/frr_exporter/resources/build.sh index 41adacd..9199c0c 100755 --- a/rpms/frr_exporter/resources/build.sh +++ b/rpms/frr_exporter/resources/build.sh @@ -1,3 +1,9 @@ #!/usr/bin/bash +set -e + curl --output - -L https://github.com/tynany/frr_exporter/releases/download/v${PACKAGE_VERSION}/frr_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 diff --git a/rpms/frr_exporter/resources/nfpm.yaml b/rpms/frr_exporter/resources/nfpm.yaml index 9d5e867..cb2262c 100644 --- a/rpms/frr_exporter/resources/nfpm.yaml +++ b/rpms/frr_exporter/resources/nfpm.yaml @@ -1,16 +1,16 @@ # nfpm.yaml -name: frr_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 Free Range Routing" -maintainer: Prometheus -homepage: https://github.com/tynany/frr_exporter -license: MIT +description: "${PACKAGE_DESCRIPTION}" +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/g10k/metadata.yaml b/rpms/g10k/metadata.yaml index 538d918..99a42e8 100644 --- a/rpms/g10k/metadata.yaml +++ b/rpms/g10k/metadata.yaml @@ -1,9 +1,18 @@ -name: g10k -release: 1 -version: 0.9.10 -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: 0.9.10 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.9.10 +description: An r10k fork written in Go, designed to work somwhat similar like puppetlabs/r10k. github: xorpaul/g10k +homepage: https://github.com/xorpaul/g10k +license: Apache2.0 +maintainer: xorpaul +name: g10k +platform: linux diff --git a/rpms/g10k/resources/build.sh b/rpms/g10k/resources/build.sh index 524387b..c70eee5 100755 --- a/rpms/g10k/resources/build.sh +++ b/rpms/g10k/resources/build.sh @@ -1,4 +1,5 @@ #!/usr/bin/bash +set -e # Download and extract g10k wget -O /app/g10k.zip https://github.com/xorpaul/g10k/releases/download/v${PACKAGE_VERSION}/g10k-v${PACKAGE_VERSION}-linux-amd64.zip @@ -6,5 +7,8 @@ pushd /app unzip /app/g10k.zip popd +# Process nfpm.yaml with envsubst +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + # Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/g10k/resources/nfpm.yaml b/rpms/g10k/resources/nfpm.yaml index 5460500..b0f090f 100644 --- a/rpms/g10k/resources/nfpm.yaml +++ b/rpms/g10k/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: g10k +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "An r10k fork written in Go, designed to work somwhat similar like puppetlabs/r10k." +description: "${PACKAGE_DESCRIPTION}" -maintainer: xorpaul -homepage: https://github.com/xorpaul/g10k -license: Apache2.0 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/helmfile/metadata.yaml b/rpms/helmfile/metadata.yaml index ed61512..6a7c591 100644 --- a/rpms/helmfile/metadata.yaml +++ b/rpms/helmfile/metadata.yaml @@ -1,9 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 1.1.7 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.1.7 +description: A declarative spec for deploying Helm charts. It lets you keep a directory of chart value files and maintain changes in version control; apply CI/CD to configuration changes; and periodically sync to avoid skew in environments. +github: helmfile/helmfile +homepage: https://github.com/helmfile/helmfile +license: MIT +maintainer: Helmfile Contributors name: helmfile -release: 1 -version: 1.1.7 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest -github: helmfile/helmfile \ No newline at end of file +platform: linux diff --git a/rpms/helmfile/resources/build.sh b/rpms/helmfile/resources/build.sh index f7f32b9..d9af0bf 100755 --- a/rpms/helmfile/resources/build.sh +++ b/rpms/helmfile/resources/build.sh @@ -1,5 +1,7 @@ #!/usr/bin/bash +set -e + # Download the required files curl -L -o /app/helmfile.tar.gz https://github.com/helmfile/helmfile/releases/download/v${PACKAGE_VERSION}/helmfile_${PACKAGE_VERSION}_linux_amd64.tar.gz @@ -10,5 +12,7 @@ tar -xzf helmfile.tar.gz # Make the binary executable chmod +x /app/helmfile -# Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/helmfile/resources/nfpm.yaml b/rpms/helmfile/resources/nfpm.yaml index 02cb4bd..cc61880 100644 --- a/rpms/helmfile/resources/nfpm.yaml +++ b/rpms/helmfile/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: helmfile +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "A declarative spec for deploying Helm charts. It lets you keep a directory of chart value files and maintain changes in version control; apply CI/CD to configuration changes; and periodically sync to avoid skew in environments." +description: "${PACKAGE_DESCRIPTION}" -maintainer: Helmfile Contributors -homepage: https://github.com/helmfile/helmfile -license: MIT +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/incus/metadata.yaml b/rpms/incus/metadata.yaml index 438dca2..9be6d3d 100644 --- a/rpms/incus/metadata.yaml +++ b/rpms/incus/metadata.yaml @@ -1,9 +1,13 @@ -name: incus -release: 1 -version: 6.10.1 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +--- +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 6.10.1 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 6.10.1 +description: incus package github: lxc/incus +name: incus diff --git a/rpms/incus/resources/build.sh b/rpms/incus/resources/build.sh index 0d24a66..0bde14a 100755 --- a/rpms/incus/resources/build.sh +++ b/rpms/incus/resources/build.sh @@ -1,5 +1,7 @@ #!/usr/bin/bash +set -e + # Install build dependencies dnf install -y \ unzip \ @@ -24,14 +26,14 @@ dnf install -y \ bash-completion \ gettext \ help2man \ - curl + curl-minimal # Download and extract incus source -curl -o /app/incus.tar.gz https://github.com/lxc/incus/archive/refs/tags/v${PACKAGE_VERSION}.tar.gz +curl -L -o /app/incus.tar.gz https://github.com/lxc/incus/archive/refs/tags/v${PACKAGE_VERSION}.tar.gz tar -C /app -xf incus.tar.gz # Install specific Go version -curl -O https://go.dev/dl/go1.24.1.linux-amd64.tar.gz +curl -L -O https://go.dev/dl/go1.24.1.linux-amd64.tar.gz rm -rf /usr/local/go tar -C /usr/local -xzf go1.24.1.linux-amd64.tar.gz diff --git a/rpms/incus/resources/nfpm_incus.yaml b/rpms/incus/resources/nfpm_incus.yaml index 6216338..ceb41cf 100644 --- a/rpms/incus/resources/nfpm_incus.yaml +++ b/rpms/incus/resources/nfpm_incus.yaml @@ -92,7 +92,7 @@ contents: # Scripts to run during installation/removal (optional) scripts: - postinstall: ./scripts/postinstall.sh - preremove: ./scripts/preremove.sh - postremove: ./scripts/postremove.sh - preinstall: ./scripts/preinstall.sh + postinstall: ./resources/scripts/postinstall.sh + preremove: ./resources/scripts/preremove.sh + postremove: ./resources/scripts/postremove.sh + preinstall: ./resources/scripts/preinstall.sh diff --git a/rpms/jellyfin-ffmpeg-bin/metadata.yaml b/rpms/jellyfin-ffmpeg-bin/metadata.yaml index ff59c84..243d457 100644 --- a/rpms/jellyfin-ffmpeg-bin/metadata.yaml +++ b/rpms/jellyfin-ffmpeg-bin/metadata.yaml @@ -1,8 +1,13 @@ +--- +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '3' + repository: [almalinux/el8] + version: 7.1.1 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '3' + repository: [almalinux/el9] + version: 7.1.1 +description: jellyfin-ffmpeg-bin package +github: unknown/jellyfin-ffmpeg-bin name: jellyfin-ffmpeg-bin -release: 3 -version: 7.1.1 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest diff --git a/rpms/jellyfin-server/metadata.yaml b/rpms/jellyfin-server/metadata.yaml index 3487ca1..873bc52 100644 --- a/rpms/jellyfin-server/metadata.yaml +++ b/rpms/jellyfin-server/metadata.yaml @@ -1,8 +1,13 @@ +--- +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 10.10.7 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 10.10.7 +description: jellyfin-server package +github: unknown/jellyfin-server name: jellyfin-server -release: 1 -version: 10.10.7 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest diff --git a/rpms/jellyfin-web/metadata.yaml b/rpms/jellyfin-web/metadata.yaml index 7308921..ed0743c 100644 --- a/rpms/jellyfin-web/metadata.yaml +++ b/rpms/jellyfin-web/metadata.yaml @@ -1,8 +1,13 @@ +--- +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 10.10.7 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 10.10.7 +description: jellyfin-web package +github: unknown/jellyfin-web name: jellyfin-web -release: 1 -version: 10.10.7 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest diff --git a/rpms/jsonnet-language-server/metadata.yaml b/rpms/jsonnet-language-server/metadata.yaml index 80f144d..50569a0 100644 --- a/rpms/jsonnet-language-server/metadata.yaml +++ b/rpms/jsonnet-language-server/metadata.yaml @@ -1,9 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 0.16.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.16.0 +description: Jsonnet Language Server Protocol implementation for the Jsonnet templating language. +github: grafana/jsonnet-language-server +homepage: https://github.com/grafana/jsonnet-language-server +license: Apache-2.0 +maintainer: Grafana Labs name: jsonnet-language-server -release: 1 -version: 0.16.0 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest -github: grafana/jsonnet-language-server \ No newline at end of file +platform: linux diff --git a/rpms/jsonnet-language-server/resources/build.sh b/rpms/jsonnet-language-server/resources/build.sh index 09af292..57a2075 100755 --- a/rpms/jsonnet-language-server/resources/build.sh +++ b/rpms/jsonnet-language-server/resources/build.sh @@ -1,10 +1,14 @@ #!/usr/bin/bash +set -e + # Download the required files curl -L -o /app/jsonnet-language-server https://github.com/grafana/jsonnet-language-server/releases/download/v${PACKAGE_VERSION}/jsonnet-language-server_${PACKAGE_VERSION}_linux_amd64 # Make the binary executable chmod +x /app/jsonnet-language-server -# Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/jsonnet-language-server/resources/nfpm.yaml b/rpms/jsonnet-language-server/resources/nfpm.yaml index 0ed09de..e492cf8 100644 --- a/rpms/jsonnet-language-server/resources/nfpm.yaml +++ b/rpms/jsonnet-language-server/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: jsonnet-language-server +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "Jsonnet Language Server Protocol implementation for the Jsonnet templating language." +description: "${PACKAGE_DESCRIPTION}" -maintainer: Grafana Labs -homepage: https://github.com/grafana/jsonnet-language-server -license: Apache-2.0 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/jsonnet-lint/metadata.yaml b/rpms/jsonnet-lint/metadata.yaml index 931e6c9..1c4bbd4 100644 --- a/rpms/jsonnet-lint/metadata.yaml +++ b/rpms/jsonnet-lint/metadata.yaml @@ -1,9 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 0.21.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.21.0 +description: Linter for Jsonnet +github: google/go-jsonnet +homepage: https://github.com/google/go-jsonnet +license: Apache-2.0 +maintainer: Google name: jsonnet-lint -release: 1 -version: 0.21.0 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest -github: google/go-jsonnet \ No newline at end of file +platform: linux diff --git a/rpms/jsonnet-lint/resources/build.sh b/rpms/jsonnet-lint/resources/build.sh index 76778fa..ee9c2fd 100755 --- a/rpms/jsonnet-lint/resources/build.sh +++ b/rpms/jsonnet-lint/resources/build.sh @@ -1,4 +1,5 @@ #!/usr/bin/bash +set -e # Install dependencies and Go 1.24 dnf install -y wget git make @@ -15,5 +16,8 @@ go version # Build jsonnet-lint binary GOBIN=/app go install github.com/google/go-jsonnet/cmd/jsonnet-lint@v${PACKAGE_VERSION} +# Process nfpm.yaml with envsubst +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + # Build RPM package -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/jsonnet-lint/resources/nfpm.yaml b/rpms/jsonnet-lint/resources/nfpm.yaml index 096fcf8..7042f5c 100644 --- a/rpms/jsonnet-lint/resources/nfpm.yaml +++ b/rpms/jsonnet-lint/resources/nfpm.yaml @@ -1,16 +1,16 @@ # nfpm.yaml -name: jsonnet-lint +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "Linter for Jsonnet" -maintainer: Google -homepage: https://github.com/google/go-jsonnet -license: Apache-2.0 +description: "${PACKAGE_DESCRIPTION}" +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/jsonnet/metadata.yaml b/rpms/jsonnet/metadata.yaml index 32d465e..cd1b6d2 100644 --- a/rpms/jsonnet/metadata.yaml +++ b/rpms/jsonnet/metadata.yaml @@ -1,9 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 0.21.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.21.0 +description: A data templating language +github: google/go-jsonnet +homepage: https://github.com/google/go-jsonnet +license: Apache-2.0 +maintainer: Google name: jsonnet -release: 1 -version: 0.21.0 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest -github: google/go-jsonnet \ No newline at end of file +platform: linux diff --git a/rpms/jsonnet/resources/build.sh b/rpms/jsonnet/resources/build.sh index ce021e5..20ea2a8 100755 --- a/rpms/jsonnet/resources/build.sh +++ b/rpms/jsonnet/resources/build.sh @@ -1,4 +1,5 @@ #!/usr/bin/bash +set -e # Install dependencies and Go 1.24 dnf install -y wget git make @@ -16,5 +17,8 @@ go version GOBIN=/app go install github.com/google/go-jsonnet/cmd/jsonnet@v${PACKAGE_VERSION} GOBIN=/app go install github.com/google/go-jsonnet/cmd/jsonnetfmt@v${PACKAGE_VERSION} +# Process nfpm.yaml with envsubst +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + # Build RPM package -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/jsonnet/resources/nfpm.yaml b/rpms/jsonnet/resources/nfpm.yaml index 7448690..1ac45ba 100644 --- a/rpms/jsonnet/resources/nfpm.yaml +++ b/rpms/jsonnet/resources/nfpm.yaml @@ -1,16 +1,16 @@ # nfpm.yaml -name: jsonnet +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "A data templating language" -maintainer: Google -homepage: https://github.com/google/go-jsonnet -license: Apache-2.0 +description: "${PACKAGE_DESCRIPTION}" +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/libfoundationdb/metadata.yaml b/rpms/libfoundationdb/metadata.yaml index d9a7aca..48c5441 100644 --- a/rpms/libfoundationdb/metadata.yaml +++ b/rpms/libfoundationdb/metadata.yaml @@ -1,9 +1,18 @@ -name: libfoundationdb -release: 1 -version: 7.3.71 +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 7.3.71 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 7.3.71 +description: FoundationDB client library - Shared library for FoundationDB applications github: apple/foundationdb -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest \ No newline at end of file +homepage: https://github.com/apple/foundationdb +license: Apache-2.0 +maintainer: FoundationDB Community +name: libfoundationdb +platform: linux diff --git a/rpms/libfoundationdb/resources/build.sh b/rpms/libfoundationdb/resources/build.sh index ddec6ba..7a1b061 100755 --- a/rpms/libfoundationdb/resources/build.sh +++ b/rpms/libfoundationdb/resources/build.sh @@ -1,10 +1,14 @@ #!/usr/bin/bash +set -e + # Download the required library curl -L -o /app/libfdb_c.so https://github.com/apple/foundationdb/releases/download/${PACKAGE_VERSION}/libfdb_c.x86_64.so # Make the library readable chmod 755 /app/libfdb_c.so -# Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/libfoundationdb/resources/nfpm.yaml b/rpms/libfoundationdb/resources/nfpm.yaml index f3692df..07c69b5 100644 --- a/rpms/libfoundationdb/resources/nfpm.yaml +++ b/rpms/libfoundationdb/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: libfoundationdb +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "FoundationDB client library - Shared library for FoundationDB applications" +description: "${PACKAGE_DESCRIPTION}" -maintainer: FoundationDB Community -homepage: https://github.com/apple/foundationdb -license: Apache-2.0 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/nfpm/metadata.yaml b/rpms/nfpm/metadata.yaml index 3e3f16b..f6c8e2d 100644 --- a/rpms/nfpm/metadata.yaml +++ b/rpms/nfpm/metadata.yaml @@ -1,9 +1,18 @@ -name: nfpm -release: 1 -version: 2.41.1 -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: 2.41.1 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 2.41.1 +description: A zero dependencies, simple deb, rpm, apk, ipk, and arch linux packager written in Go. github: goreleaser/nfpm +homepage: https://nfpm.goreleaser.com/ +license: MIT +maintainer: GoReleaser +name: nfpm +platform: linux diff --git a/rpms/nfpm/resources/build.sh b/rpms/nfpm/resources/build.sh index b4ecf19..6542214 100755 --- a/rpms/nfpm/resources/build.sh +++ b/rpms/nfpm/resources/build.sh @@ -1,7 +1,11 @@ #!/usr/bin/bash +set -e # Compile nfpm binary using Go GOBIN=/app go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v${PACKAGE_VERSION} +# Process nfpm.yaml with envsubst +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + # Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/nfpm/resources/nfpm.yaml b/rpms/nfpm/resources/nfpm.yaml index 131bfd4..f35bc63 100644 --- a/rpms/nfpm/resources/nfpm.yaml +++ b/rpms/nfpm/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: nfpm +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "A zero dependencies, simple deb, rpm, apk, ipk, and arch linux packager written in Go." +description: "${PACKAGE_DESCRIPTION}" -maintainer: GoReleaser -homepage: https://nfpm.goreleaser.com/ -license: MIT +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/node_exporter/metadata.yaml b/rpms/node_exporter/metadata.yaml index f7c6ac9..497c9e3 100644 --- a/rpms/node_exporter/metadata.yaml +++ b/rpms/node_exporter/metadata.yaml @@ -1,8 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 1.9.1 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.9.1 +description: exporter for machine metrics +github: prometheus/node_exporter +homepage: https://github.com/prometheus/node_exporter +license: Apache-2.0 license +maintainer: Prometheus name: node_exporter -release: 1 -version: 1.9.1 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +platform: linux diff --git a/rpms/node_exporter/resources/build.sh b/rpms/node_exporter/resources/build.sh index 4806f50..e6924ad 100755 --- a/rpms/node_exporter/resources/build.sh +++ b/rpms/node_exporter/resources/build.sh @@ -1,6 +1,11 @@ #!/usr/bin/bash +set -e + # Download the required files curl --output - -L https://github.com/prometheus/node_exporter/releases/download/v${PACKAGE_VERSION}/node_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 the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm diff --git a/rpms/node_exporter/resources/nfpm.yaml b/rpms/node_exporter/resources/nfpm.yaml index bfc1893..c5666c5 100644 --- a/rpms/node_exporter/resources/nfpm.yaml +++ b/rpms/node_exporter/resources/nfpm.yaml @@ -1,16 +1,16 @@ # nfpm.yaml -name: node_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: "exporter for machine metrics" -maintainer: Prometheus -homepage: https://github.com/prometheus/node_exporter -license: Apache-2.0 license +description: "${PACKAGE_DESCRIPTION}" +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/nomad-autoscaler/metadata.yaml b/rpms/nomad-autoscaler/metadata.yaml index eda863d..34b6a90 100644 --- a/rpms/nomad-autoscaler/metadata.yaml +++ b/rpms/nomad-autoscaler/metadata.yaml @@ -1,8 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 0.4.6 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.4.6 +description: The Nomad Autoscaler is an autoscaling daemon for Nomad, architectured around plug-ins to allow for easy extensibility in terms of supported metrics sources, scaling targets and scaling algorithms. +github: hashicorp/nomad-autoscaler +homepage: https://github.com/hashicorp/nomad-autoscaler +license: Mozilla Public License, version 2.0 +maintainer: Hashicorp name: nomad-autoscaler -release: 1 -version: 0.4.6 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +platform: linux diff --git a/rpms/nomad-autoscaler/resources/build.sh b/rpms/nomad-autoscaler/resources/build.sh index 31139d1..6287e9e 100755 --- a/rpms/nomad-autoscaler/resources/build.sh +++ b/rpms/nomad-autoscaler/resources/build.sh @@ -1,11 +1,15 @@ #!/usr/bin/bash +set -e + # Install dependencies dnf install -y unzip # Download and extract nomad-autoscaler -curl -o /app/nomad-autoscaler.zip https://releases.hashicorp.com/nomad-autoscaler/${PACKAGE_VERSION}/nomad-autoscaler_${PACKAGE_VERSION}_linux_amd64.zip +curl -L -o /app/nomad-autoscaler.zip https://releases.hashicorp.com/nomad-autoscaler/${PACKAGE_VERSION}/nomad-autoscaler_${PACKAGE_VERSION}_linux_amd64.zip unzip nomad-autoscaler.zip -# Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/nomad-autoscaler/resources/nfpm.yaml b/rpms/nomad-autoscaler/resources/nfpm.yaml index 2d6b740..2b4a05f 100644 --- a/rpms/nomad-autoscaler/resources/nfpm.yaml +++ b/rpms/nomad-autoscaler/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: nomad-autoscaler +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "The Nomad Autoscaler is an autoscaling daemon for Nomad, architectured around plug-ins to allow for easy extensibility in terms of supported metrics sources, scaling targets and scaling algorithms." +description: "${PACKAGE_DESCRIPTION}" -maintainer: Hashicorp -homepage: https://github.com/hashicorp/nomad-autoscaler -license: Mozilla Public License, version 2.0 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/nomad/metadata.yaml b/rpms/nomad/metadata.yaml index 441470d..3561ac4 100644 --- a/rpms/nomad/metadata.yaml +++ b/rpms/nomad/metadata.yaml @@ -1,8 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 1.10.1 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.10.1 +description: A simple and flexible scheduler and orchestrator to deploy and manage containers and non-containerized applications across on-premises and clouds at scale. +github: unknown/nomad +homepage: https://www.nomadproject.io/ +license: BUSL-1.1 +maintainer: HashiCorp name: nomad -release: 1 -version: 1.10.1 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +platform: linux diff --git a/rpms/nomad/resources/build.sh b/rpms/nomad/resources/build.sh index f1ff62d..7ec34b3 100755 --- a/rpms/nomad/resources/build.sh +++ b/rpms/nomad/resources/build.sh @@ -1,11 +1,15 @@ #!/usr/bin/bash +set -e + # Install dependencies dnf install -y unzip # Download and extract nomad -curl -o /app/nomad.zip https://releases.hashicorp.com/nomad/${PACKAGE_VERSION}/nomad_${PACKAGE_VERSION}_linux_amd64.zip +curl -L -o /app/nomad.zip https://releases.hashicorp.com/nomad/${PACKAGE_VERSION}/nomad_${PACKAGE_VERSION}_linux_amd64.zip unzip nomad.zip -# Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/nomad/resources/nfpm.yaml b/rpms/nomad/resources/nfpm.yaml index 9006ef6..f709426 100644 --- a/rpms/nomad/resources/nfpm.yaml +++ b/rpms/nomad/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: nomad +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "A simple and flexible scheduler and orchestrator to deploy and manage containers and non-containerized applications across on-premises and clouds at scale." +description: "${PACKAGE_DESCRIPTION}" -maintainer: HashiCorp -homepage: https://www.nomadproject.io/ -license: BUSL-1.1 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/nzbget/metadata.yaml b/rpms/nzbget/metadata.yaml index 7383789..18b4037 100644 --- a/rpms/nzbget/metadata.yaml +++ b/rpms/nzbget/metadata.yaml @@ -1,9 +1,18 @@ -name: nzbget -release: 1 -version: '25.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: '25.0' + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: '25.0' +description: NZBGet is a binary downloader, which downloads files from Usenet based-on information given in nzb files. github: nzbgetcom/nzbget +homepage: https://github.com/nzbgetcom/nzbget +license: GPL-2.0 +maintainer: nzbgetcom +name: nzbget +platform: linux diff --git a/rpms/nzbget/resources/build.sh b/rpms/nzbget/resources/build.sh index d099963..700a56e 100755 --- a/rpms/nzbget/resources/build.sh +++ b/rpms/nzbget/resources/build.sh @@ -1,5 +1,7 @@ #!/usr/bin/bash +set -e + # Download the pre-built RPM from GitHub releases -curl -o /app/dist/nzbget-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.x86_64.rpm \ +curl -L -o /app/dist/nzbget-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.x86_64.rpm \ https://github.com/nzbgetcom/nzbget/releases/download/v$PACKAGE_VERSION/nzbget-${PACKAGE_VERSION}-${PACKAGE_RELEASE}.x86_64.rpm \ No newline at end of file diff --git a/rpms/nzbget/resources/nfpm.yaml b/rpms/nzbget/resources/nfpm.yaml index 44150f5..2af4b73 100644 --- a/rpms/nzbget/resources/nfpm.yaml +++ b/rpms/nzbget/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: nzbget +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "NZBGet is a binary downloader, which downloads files from Usenet based-on information given in nzb files." +description: "${PACKAGE_DESCRIPTION}" -maintainer: nzbgetcom -homepage: https://github.com/nzbgetcom/nzbget -license: GPL-2.0 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/nzbget_exporter/metadata.yaml b/rpms/nzbget_exporter/metadata.yaml index 1006946..e91a21c 100644 --- a/rpms/nzbget_exporter/metadata.yaml +++ b/rpms/nzbget_exporter/metadata.yaml @@ -1,9 +1,18 @@ -name: nzbget_exporter -release: 1 -version: 2025.08.03 +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 2025.08.03 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 2025.08.03 +description: Prometheus exporter for NZBGet github: frebib/nzbget-exporter -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +homepage: https://github.com/frebib/nzbget-exporter +license: MIT +maintainer: Prometheus +name: nzbget_exporter +platform: linux diff --git a/rpms/nzbget_exporter/resources/build.sh b/rpms/nzbget_exporter/resources/build.sh index a9be3c7..a713c02 100755 --- a/rpms/nzbget_exporter/resources/build.sh +++ b/rpms/nzbget_exporter/resources/build.sh @@ -1,4 +1,6 @@ #!/usr/bin/bash +set -e + cd /app git clone https://github.com/frebib/nzbget-exporter.git go install github.com/frebib/enumerx@latest @@ -7,4 +9,8 @@ pushd /app/nzbget-exporter go generate go build -o ../nzbget_exporter popd -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 diff --git a/rpms/nzbget_exporter/resources/nfpm.yaml b/rpms/nzbget_exporter/resources/nfpm.yaml index 4cd660b..7d71904 100644 --- a/rpms/nzbget_exporter/resources/nfpm.yaml +++ b/rpms/nzbget_exporter/resources/nfpm.yaml @@ -1,16 +1,16 @@ # nfpm.yaml -name: nzbget_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 NZBGet" -maintainer: Prometheus -homepage: https://github.com/frebib/nzbget-exporter -license: MIT +description: "${PACKAGE_DESCRIPTION}" +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/openbao-plugin-secret-consul/metadata.yaml b/rpms/openbao-plugin-secret-consul/metadata.yaml index 8a336ec..dac48b4 100644 --- a/rpms/openbao-plugin-secret-consul/metadata.yaml +++ b/rpms/openbao-plugin-secret-consul/metadata.yaml @@ -1,9 +1,18 @@ -name: openbao-plugin-secret-consul -release: 1 -version: 0.1.0 +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 0.1.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.1.0 +description: OpenBao secrets engine plugin for HashiCorp Consul github: openbao/openbao-plugins -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest \ No newline at end of file +homepage: https://github.com/openbao/openbao-plugins +license: MPL-2.0 +maintainer: OpenBao Community +name: openbao-plugin-secret-consul +platform: linux diff --git a/rpms/openbao-plugin-secret-consul/resources/build.sh b/rpms/openbao-plugin-secret-consul/resources/build.sh index 1cab061..1d9ec50 100755 --- a/rpms/openbao-plugin-secret-consul/resources/build.sh +++ b/rpms/openbao-plugin-secret-consul/resources/build.sh @@ -1,5 +1,7 @@ #!/usr/bin/bash +set -e + # Download the required files curl -L -o /app/openbao-plugin-secrets-consul.tar.gz https://github.com/openbao/openbao-plugins/releases/download/secrets-consul-v${PACKAGE_VERSION}/openbao-plugin-secrets-consul_linux_amd64_v1.tar.gz @@ -12,5 +14,7 @@ mv /app/openbao-plugin-secrets-consul_linux_amd64_v1 /app/openbao-plugin-secrets # Make the binary executable chmod +x /app/openbao-plugin-secrets-consul -# Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/openbao-plugin-secret-consul/resources/nfpm.yaml b/rpms/openbao-plugin-secret-consul/resources/nfpm.yaml index c485751..c7be86f 100644 --- a/rpms/openbao-plugin-secret-consul/resources/nfpm.yaml +++ b/rpms/openbao-plugin-secret-consul/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: openbao-plugin-secret-consul +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "OpenBao secrets engine plugin for HashiCorp Consul" +description: "${PACKAGE_DESCRIPTION}" -maintainer: OpenBao Community -homepage: https://github.com/openbao/openbao-plugins -license: MPL-2.0 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/openbao-plugin-secret-nomad/metadata.yaml b/rpms/openbao-plugin-secret-nomad/metadata.yaml index dd596b9..835db83 100644 --- a/rpms/openbao-plugin-secret-nomad/metadata.yaml +++ b/rpms/openbao-plugin-secret-nomad/metadata.yaml @@ -1,9 +1,18 @@ -name: openbao-plugin-secret-nomad -release: 1 -version: 0.1.4 +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 0.1.4 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.1.4 +description: OpenBao secrets engine plugin for HashiCorp Nomad github: openbao/openbao-plugins -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest \ No newline at end of file +homepage: https://github.com/openbao/openbao-plugins +license: MPL-2.0 +maintainer: OpenBao Community +name: openbao-plugin-secret-nomad +platform: linux diff --git a/rpms/openbao-plugin-secret-nomad/resources/build.sh b/rpms/openbao-plugin-secret-nomad/resources/build.sh index d1902df..8a59f0e 100755 --- a/rpms/openbao-plugin-secret-nomad/resources/build.sh +++ b/rpms/openbao-plugin-secret-nomad/resources/build.sh @@ -1,5 +1,7 @@ #!/usr/bin/bash +set -e + # Download the required files curl -L -o /app/openbao-plugin-secrets-nomad.tar.gz https://github.com/openbao/openbao-plugins/releases/download/secrets-nomad-v${PACKAGE_VERSION}/openbao-plugin-secrets-nomad_linux_amd64_v1.tar.gz @@ -12,5 +14,7 @@ mv /app/openbao-plugin-secrets-nomad_linux_amd64_v1 /app/openbao-plugin-secrets- # Make the binary executable chmod +x /app/openbao-plugin-secrets-nomad -# Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/openbao-plugin-secret-nomad/resources/nfpm.yaml b/rpms/openbao-plugin-secret-nomad/resources/nfpm.yaml index d355b64..96a8102 100644 --- a/rpms/openbao-plugin-secret-nomad/resources/nfpm.yaml +++ b/rpms/openbao-plugin-secret-nomad/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: openbao-plugin-secret-nomad +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "OpenBao secrets engine plugin for HashiCorp Nomad" +description: "${PACKAGE_DESCRIPTION}" -maintainer: OpenBao Community -homepage: https://github.com/openbao/openbao-plugins -license: MPL-2.0 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/openbao-plugins/metadata.yaml b/rpms/openbao-plugins/metadata.yaml index a7ca334..75365f4 100644 --- a/rpms/openbao-plugins/metadata.yaml +++ b/rpms/openbao-plugins/metadata.yaml @@ -1,9 +1,18 @@ -name: openbao-plugins -release: 1 -version: 1.0.0 +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 1.0.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.0.0 +description: Meta package that installs all OpenBao plugins github: openbao/openbao-plugins -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest \ No newline at end of file +homepage: https://github.com/openbao/openbao-plugins +license: MPL-2.0 +maintainer: OpenBao Community +name: openbao-plugins +platform: linux diff --git a/rpms/openbao-plugins/resources/build.sh b/rpms/openbao-plugins/resources/build.sh index 9dc1412..2afe6d8 100755 --- a/rpms/openbao-plugins/resources/build.sh +++ b/rpms/openbao-plugins/resources/build.sh @@ -1,5 +1,10 @@ #!/usr/bin/bash +set -e # This is a meta package - no binaries to download + +# Process nfpm.yaml with envsubst +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + # Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/openbao-plugins/resources/nfpm.yaml b/rpms/openbao-plugins/resources/nfpm.yaml index 4569040..89649bc 100644 --- a/rpms/openbao-plugins/resources/nfpm.yaml +++ b/rpms/openbao-plugins/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: openbao-plugins +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "Meta package that installs all OpenBao plugins" +description: "${PACKAGE_DESCRIPTION}" -maintainer: OpenBao Community -homepage: https://github.com/openbao/openbao-plugins -license: MPL-2.0 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/packer/metadata.yaml b/rpms/packer/metadata.yaml index 446a761..8f5df42 100644 --- a/rpms/packer/metadata.yaml +++ b/rpms/packer/metadata.yaml @@ -1,8 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 1.13.1 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.13.1 +description: Create identical images for multiple platforms from a single source configuration. +github: unknown/packer +homepage: https://www.packer.io/ +license: BUSL-1.1 +maintainer: HashiCorp name: packer -release: 1 -version: 1.13.1 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +platform: linux diff --git a/rpms/packer/resources/build.sh b/rpms/packer/resources/build.sh index b87c4de..9e67b4d 100755 --- a/rpms/packer/resources/build.sh +++ b/rpms/packer/resources/build.sh @@ -1,11 +1,16 @@ #!/usr/bin/bash +set -e + # Install dependencies dnf install -y unzip # Download and extract packer -curl -o /app/packer.zip https://releases.hashicorp.com/packer/${PACKAGE_VERSION}/packer_${PACKAGE_VERSION}_linux_amd64.zip +curl -L -o /app/packer.zip https://releases.hashicorp.com/packer/${PACKAGE_VERSION}/packer_${PACKAGE_VERSION}_linux_amd64.zip unzip packer.zip +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + # Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/packer/resources/nfpm.yaml b/rpms/packer/resources/nfpm.yaml index 5c48f6b..ba903ff 100644 --- a/rpms/packer/resources/nfpm.yaml +++ b/rpms/packer/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: packer +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "Create identical images for multiple platforms from a single source configuration." +description: "${PACKAGE_DESCRIPTION}" -maintainer: HashiCorp -homepage: https://www.packer.io/ -license: BUSL-1.1 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/pgbouncer_exporter/metadata.yaml b/rpms/pgbouncer_exporter/metadata.yaml index bacf173..bd1f2c6 100644 --- a/rpms/pgbouncer_exporter/metadata.yaml +++ b/rpms/pgbouncer_exporter/metadata.yaml @@ -1,8 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 0.11.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.11.0 +description: Prometheus exporter for PgBouncer +github: prometheus-community/pgbouncer_exporter +homepage: https://github.com/prometheus-community/pgbouncer_exporter +license: Apache-2.0 license +maintainer: Prometheus name: pgbouncer_exporter -release: 1 -version: 0.11.0 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +platform: linux diff --git a/rpms/pgbouncer_exporter/resources/build.sh b/rpms/pgbouncer_exporter/resources/build.sh index 32dd9d3..55f0c91 100755 --- a/rpms/pgbouncer_exporter/resources/build.sh +++ b/rpms/pgbouncer_exporter/resources/build.sh @@ -1,6 +1,10 @@ #!/usr/bin/bash +set -e # Download the required files curl --output - -L https://github.com/prometheus-community/pgbouncer_exporter/releases/download/v${PACKAGE_VERSION}/pgbouncer_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 diff --git a/rpms/pgbouncer_exporter/resources/nfpm.yaml b/rpms/pgbouncer_exporter/resources/nfpm.yaml index 6cce9ce..2aea2cf 100644 --- a/rpms/pgbouncer_exporter/resources/nfpm.yaml +++ b/rpms/pgbouncer_exporter/resources/nfpm.yaml @@ -1,16 +1,16 @@ # nfpm.yaml -name: pgbouncer_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 PgBouncer" -maintainer: Prometheus -homepage: https://github.com/prometheus-community/pgbouncer_exporter -license: Apache-2.0 license +description: "${PACKAGE_DESCRIPTION}" +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/postgres_exporter/metadata.yaml b/rpms/postgres_exporter/metadata.yaml index 6896108..1e417e8 100644 --- a/rpms/postgres_exporter/metadata.yaml +++ b/rpms/postgres_exporter/metadata.yaml @@ -1,8 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 0.17.1 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.17.1 +description: A PostgreSQL metric exporter for Prometheus +github: prometheus-community/postgres_exporter +homepage: https://github.com/prometheus-community/postgres_exporter +license: Apache-2.0 license +maintainer: Prometheus name: postgres_exporter -release: 1 -version: 0.17.1 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +platform: linux diff --git a/rpms/postgres_exporter/resources/build.sh b/rpms/postgres_exporter/resources/build.sh index fd257fd..ceff5db 100755 --- a/rpms/postgres_exporter/resources/build.sh +++ b/rpms/postgres_exporter/resources/build.sh @@ -1,6 +1,10 @@ #!/usr/bin/bash +set -e # Download the required files curl --output - -L https://github.com/prometheus-community/postgres_exporter/releases/download/v${PACKAGE_VERSION}/postgres_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 diff --git a/rpms/postgres_exporter/resources/nfpm.yaml b/rpms/postgres_exporter/resources/nfpm.yaml index f73146c..ea0787a 100644 --- a/rpms/postgres_exporter/resources/nfpm.yaml +++ b/rpms/postgres_exporter/resources/nfpm.yaml @@ -1,16 +1,16 @@ # nfpm.yaml -name: postgres_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: "A PostgreSQL metric exporter for Prometheus" -maintainer: Prometheus -homepage: https://github.com/prometheus-community/postgres_exporter -license: Apache-2.0 license +description: "${PACKAGE_DESCRIPTION}" +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/puppet-initial/metadata.yaml b/rpms/puppet-initial/metadata.yaml index e637c66..46779a5 100644 --- a/rpms/puppet-initial/metadata.yaml +++ b/rpms/puppet-initial/metadata.yaml @@ -1,8 +1,17 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 1.0.3 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.0.3 +description: A script and service to initialise puppet for the unkin environmnet. +github: unknown/puppet-initial +license: MIT +maintainer: UNKIN name: puppet-initial -release: 1 -version: 1.0.3 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +platform: linux diff --git a/rpms/puppet-initial/resources/build.sh b/rpms/puppet-initial/resources/build.sh index ae730e3..09ca8cf 100755 --- a/rpms/puppet-initial/resources/build.sh +++ b/rpms/puppet-initial/resources/build.sh @@ -1,2 +1,7 @@ #!/usr/bin/bash -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm +set -e + +# Process nfpm.yaml with envsubst +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm diff --git a/rpms/puppet-initial/resources/nfpm.yaml b/rpms/puppet-initial/resources/nfpm.yaml index 9807756..68ae453 100644 --- a/rpms/puppet-initial/resources/nfpm.yaml +++ b/rpms/puppet-initial/resources/nfpm.yaml @@ -1,16 +1,16 @@ # nfpm.yaml -name: puppet-initial +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "A script and service to initialise puppet for the unkin environmnet." +description: "${PACKAGE_DESCRIPTION}" -maintainer: UNKIN -license: MIT +maintainer: ${PACKAGE_MAINTAINER} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/puppetdb_exporter/metadata.yaml b/rpms/puppetdb_exporter/metadata.yaml index a05af14..bd9deec 100644 --- a/rpms/puppetdb_exporter/metadata.yaml +++ b/rpms/puppetdb_exporter/metadata.yaml @@ -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 diff --git a/rpms/puppetdb_exporter/resources/build.sh b/rpms/puppetdb_exporter/resources/build.sh index a76c6d8..c89fe7a 100755 --- a/rpms/puppetdb_exporter/resources/build.sh +++ b/rpms/puppetdb_exporter/resources/build.sh @@ -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 diff --git a/rpms/puppetdb_exporter/resources/nfpm.yaml b/rpms/puppetdb_exporter/resources/nfpm.yaml index 22155d6..3ae1891 100644 --- a/rpms/puppetdb_exporter/resources/nfpm.yaml +++ b/rpms/puppetdb_exporter/resources/nfpm.yaml @@ -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 diff --git a/rpms/ruff/metadata.yaml b/rpms/ruff/metadata.yaml index 426dd67..c0653c1 100644 --- a/rpms/ruff/metadata.yaml +++ b/rpms/ruff/metadata.yaml @@ -1,9 +1,18 @@ -name: ruff -release: 6 -version: 0.8.1 -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: '6' + repository: [almalinux/el8] + version: 0.8.1 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '6' + repository: [almalinux/el9] + version: 0.8.1 +description: An extremely fast Python linter and code formatter, written in Rust. github: astral-sh/ruff +homepage: https://docs.astral.sh/ruff/ +license: Apache-2.0 +maintainer: Astral.sh +name: ruff +platform: linux diff --git a/rpms/ruff/resources/build.sh b/rpms/ruff/resources/build.sh index 937a58e..c8c2144 100755 --- a/rpms/ruff/resources/build.sh +++ b/rpms/ruff/resources/build.sh @@ -1,9 +1,14 @@ #!/usr/bin/bash +set -e + # Download and extract ruff wget -O /app/ruff-x86_64-unknown-linux-gnu.tar.gz https://github.com/astral-sh/ruff/releases/download/${PACKAGE_VERSION}/ruff-x86_64-unknown-linux-gnu.tar.gz tar xf /app/ruff-x86_64-unknown-linux-gnu.tar.gz mv /app/ruff-x86_64-unknown-linux-gnu/* /app/ +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + # Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/ruff/resources/nfpm.yaml b/rpms/ruff/resources/nfpm.yaml index 0e2f923..3c81512 100644 --- a/rpms/ruff/resources/nfpm.yaml +++ b/rpms/ruff/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: ruff +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "An extremely fast Python linter and code formatter, written in Rust." +description: "${PACKAGE_DESCRIPTION}" -maintainer: Astral.sh -homepage: https://docs.astral.sh/ruff/ -license: Apache-2.0 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/stalwart-cli/metadata.yaml b/rpms/stalwart-cli/metadata.yaml index b4aefd5..83d9cd6 100644 --- a/rpms/stalwart-cli/metadata.yaml +++ b/rpms/stalwart-cli/metadata.yaml @@ -1,9 +1,18 @@ -name: stalwart-cli -release: 1 -version: 0.13.4 +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 0.13.4 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.13.4 +description: Stalwart CLI - Command line interface for Stalwart Mail Server github: stalwartlabs/stalwart -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest \ No newline at end of file +homepage: https://stalw.art +license: AGPL-3.0 +maintainer: Stalwart Labs +name: stalwart-cli +platform: linux diff --git a/rpms/stalwart-cli/resources/build.sh b/rpms/stalwart-cli/resources/build.sh index bca6790..ca9d055 100755 --- a/rpms/stalwart-cli/resources/build.sh +++ b/rpms/stalwart-cli/resources/build.sh @@ -1,5 +1,7 @@ #!/usr/bin/bash +set -e + # Download the required files curl -L -o /app/stalwart-cli.tar.gz https://github.com/stalwartlabs/stalwart/releases/download/v${PACKAGE_VERSION}/stalwart-cli-x86_64-unknown-linux-gnu.tar.gz @@ -9,5 +11,7 @@ tar -xzf /app/stalwart-cli.tar.gz -C /app # Make the binary executable chmod +x /app/stalwart-cli -# Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/stalwart-cli/resources/nfpm.yaml b/rpms/stalwart-cli/resources/nfpm.yaml index f44f412..76946b8 100644 --- a/rpms/stalwart-cli/resources/nfpm.yaml +++ b/rpms/stalwart-cli/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: stalwart-cli +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "Stalwart CLI - Command line interface for Stalwart Mail Server" +description: "${PACKAGE_DESCRIPTION}" -maintainer: Stalwart Labs -homepage: https://stalw.art -license: AGPL-3.0 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/stalwart-foundationdb/metadata.yaml b/rpms/stalwart-foundationdb/metadata.yaml index 4de8a8c..20d0164 100644 --- a/rpms/stalwart-foundationdb/metadata.yaml +++ b/rpms/stalwart-foundationdb/metadata.yaml @@ -1,9 +1,18 @@ -name: stalwart-foundationdb -release: 1 -version: 0.13.4 +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 0.13.4 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.13.4 +description: Stalwart Mail Server with FoundationDB support - A modern, secure JMAP, IMAP and SMTP mail server github: stalwartlabs/stalwart -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest \ No newline at end of file +homepage: https://stalw.art +license: AGPL-3.0 +maintainer: Stalwart Labs +name: stalwart-foundationdb +platform: linux diff --git a/rpms/stalwart-foundationdb/resources/build.sh b/rpms/stalwart-foundationdb/resources/build.sh index e9b1e6d..9ebca50 100755 --- a/rpms/stalwart-foundationdb/resources/build.sh +++ b/rpms/stalwart-foundationdb/resources/build.sh @@ -1,5 +1,7 @@ #!/usr/bin/bash +set -e + # Download the required files curl -L -o /app/stalwart-foundationdb.tar.gz https://github.com/stalwartlabs/stalwart/releases/download/v${PACKAGE_VERSION}/stalwart-foundationdb-x86_64-unknown-linux-gnu.tar.gz @@ -9,5 +11,7 @@ tar -xzf /app/stalwart-foundationdb.tar.gz -C /app # Make the binary executable chmod +x /app/stalwart-foundationdb -# Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/stalwart-foundationdb/resources/nfpm.yaml b/rpms/stalwart-foundationdb/resources/nfpm.yaml index 261e76e..ea765a5 100644 --- a/rpms/stalwart-foundationdb/resources/nfpm.yaml +++ b/rpms/stalwart-foundationdb/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: stalwart-foundationdb +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "Stalwart Mail Server with FoundationDB support - A modern, secure JMAP, IMAP and SMTP mail server" +description: "${PACKAGE_DESCRIPTION}" -maintainer: Stalwart Labs -homepage: https://stalw.art -license: AGPL-3.0 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/stalwart/metadata.yaml b/rpms/stalwart/metadata.yaml index 982a906..645783c 100644 --- a/rpms/stalwart/metadata.yaml +++ b/rpms/stalwart/metadata.yaml @@ -1,9 +1,18 @@ -name: stalwart -release: 1 -version: 0.13.4 +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 0.13.4 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.13.4 +description: Stalwart Mail Server - A modern, secure JMAP, IMAP and SMTP mail server github: stalwartlabs/stalwart -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest \ No newline at end of file +homepage: https://stalw.art +license: AGPL-3.0 +maintainer: Stalwart Labs +name: stalwart +platform: linux diff --git a/rpms/stalwart/resources/build.sh b/rpms/stalwart/resources/build.sh index e13b029..35214c1 100755 --- a/rpms/stalwart/resources/build.sh +++ b/rpms/stalwart/resources/build.sh @@ -1,5 +1,7 @@ #!/usr/bin/bash +set -e + # Download the required files curl -L -o /app/stalwart.tar.gz https://github.com/stalwartlabs/stalwart/releases/download/v${PACKAGE_VERSION}/stalwart-x86_64-unknown-linux-gnu.tar.gz @@ -9,5 +11,7 @@ tar -xzf /app/stalwart.tar.gz -C /app # Make the binary executable chmod +x /app/stalwart -# Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/stalwart/resources/nfpm.yaml b/rpms/stalwart/resources/nfpm.yaml index 877ef5d..4990c02 100644 --- a/rpms/stalwart/resources/nfpm.yaml +++ b/rpms/stalwart/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: stalwart +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "Stalwart Mail Server - A modern, secure JMAP, IMAP and SMTP mail server" +description: "${PACKAGE_DESCRIPTION}" -maintainer: Stalwart Labs -homepage: https://stalw.art -license: AGPL-3.0 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/terraform/metadata.yaml b/rpms/terraform/metadata.yaml index a3fd14d..64f72a3 100644 --- a/rpms/terraform/metadata.yaml +++ b/rpms/terraform/metadata.yaml @@ -1,8 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 1.5.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.5.0 +description: Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned. +github: unknown/terraform +homepage: https://terraform.io/ +license: BUSL-1.1 +maintainer: HashiCorp name: terraform -release: 1 -version: 1.5.0 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +platform: linux diff --git a/rpms/terraform/resources/build.sh b/rpms/terraform/resources/build.sh index 4bfdbb2..f11c0bf 100755 --- a/rpms/terraform/resources/build.sh +++ b/rpms/terraform/resources/build.sh @@ -1,11 +1,16 @@ #!/usr/bin/bash +set -e + # Install dependencies dnf install -y unzip # Download and extract terraform -curl -o /app/terraform.zip https://releases.hashicorp.com/terraform/${PACKAGE_VERSION}/terraform_${PACKAGE_VERSION}_linux_amd64.zip +curl -L -o /app/terraform.zip https://releases.hashicorp.com/terraform/${PACKAGE_VERSION}/terraform_${PACKAGE_VERSION}_linux_amd64.zip unzip terraform.zip +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + # Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/terraform/resources/nfpm.yaml b/rpms/terraform/resources/nfpm.yaml index 5853901..0c68227 100644 --- a/rpms/terraform/resources/nfpm.yaml +++ b/rpms/terraform/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: terraform +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned." +description: "${PACKAGE_DESCRIPTION}" -maintainer: HashiCorp -homepage: https://terraform.io/ -license: BUSL-1.1 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/terragrunt/metadata.yaml b/rpms/terragrunt/metadata.yaml index 5333351..4695def 100644 --- a/rpms/terragrunt/metadata.yaml +++ b/rpms/terragrunt/metadata.yaml @@ -1,9 +1,18 @@ -name: terragrunt -release: 1 -version: 0.90.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: 0.90.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.90.0 +description: Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale. github: gruntwork-io/terragrunt +homepage: https://github.com/gruntwork-io/terragrunt +license: MIT +maintainer: Gruntwork +name: terragrunt +platform: linux diff --git a/rpms/terragrunt/resources/build.sh b/rpms/terragrunt/resources/build.sh index 09a5f70..7561b18 100755 --- a/rpms/terragrunt/resources/build.sh +++ b/rpms/terragrunt/resources/build.sh @@ -1,7 +1,12 @@ #!/usr/bin/bash +set -e + # Download terragrunt binary wget -O /app/terragrunt https://github.com/gruntwork-io/terragrunt/releases/download/v${PACKAGE_VERSION}/terragrunt_linux_amd64 +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + # Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/terragrunt/resources/nfpm.yaml b/rpms/terragrunt/resources/nfpm.yaml index 551640d..d21ce61 100644 --- a/rpms/terragrunt/resources/nfpm.yaml +++ b/rpms/terragrunt/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: terragrunt +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale." +description: "${PACKAGE_DESCRIPTION}" -maintainer: Gruntwork -homepage: https://github.com/gruntwork-io/terragrunt -license: MIT +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/tflint/metadata.yaml b/rpms/tflint/metadata.yaml index 2b40717..48c6107 100644 --- a/rpms/tflint/metadata.yaml +++ b/rpms/tflint/metadata.yaml @@ -1,9 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 0.59.1 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.59.1 +description: A Pluggable Terraform Linter that finds potential errors in Terraform configurations and enforces best practices. +github: terraform-linters/tflint +homepage: https://github.com/terraform-linters/tflint +license: MPL-2.0 +maintainer: Terraform Linters 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 +platform: linux diff --git a/rpms/tflint/resources/build.sh b/rpms/tflint/resources/build.sh index 124c455..c058634 100755 --- a/rpms/tflint/resources/build.sh +++ b/rpms/tflint/resources/build.sh @@ -1,4 +1,5 @@ #!/usr/bin/bash +set -e # 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 @@ -6,5 +7,8 @@ wget -O /app/tflint_linux_amd64.zip https://github.com/terraform-linters/tflint/ # Extract the binary unzip -j /app/tflint_linux_amd64.zip -d /app/ +# Process nfpm.yaml with envsubst +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + # Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +nfpm pkg --config /app/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 index a3cf545..253d8cb 100644 --- a/rpms/tflint/resources/nfpm.yaml +++ b/rpms/tflint/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: tflint +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "A Pluggable Terraform Linter that finds potential errors in Terraform configurations and enforces best practices." +description: "${PACKAGE_DESCRIPTION}" -maintainer: Terraform Linters -homepage: https://github.com/terraform-linters/tflint -license: MPL-2.0 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/unkin-ca-certificates/metadata.yaml b/rpms/unkin-ca-certificates/metadata.yaml index 1a80800..9bfaf6c 100644 --- a/rpms/unkin-ca-certificates/metadata.yaml +++ b/rpms/unkin-ca-certificates/metadata.yaml @@ -1,8 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 2025.07.13 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 2025.07.13 +description: ca-certificates for the unkin site +github: unknown/unkin-ca-certificates +homepage: https://vault.query.consul:8200 +license: Apache-2.0 +maintainer: Unkin name: unkin-ca-certificates -release: 1 -version: 2025.07.13 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +platform: linux diff --git a/rpms/unkin-ca-certificates/resources/build.sh b/rpms/unkin-ca-certificates/resources/build.sh index f9cedae..ff2bd21 100755 --- a/rpms/unkin-ca-certificates/resources/build.sh +++ b/rpms/unkin-ca-certificates/resources/build.sh @@ -1,7 +1,11 @@ #!/usr/bin/bash -# Download the CA certificate from vault -curl -o /app/UNKIN_ROOTCA_2024.crt https://vault.query.consul:8200/v1/pki_root/ca/pem +set -e -# Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +# Download the CA certificate from vault +curl -L -o /app/UNKIN_ROOTCA_2024.crt https://vault.query.consul:8200/v1/pki_root/ca/pem + +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/unkin-ca-certificates/resources/nfpm.yaml b/rpms/unkin-ca-certificates/resources/nfpm.yaml index ed8e8b1..e3ec751 100644 --- a/rpms/unkin-ca-certificates/resources/nfpm.yaml +++ b/rpms/unkin-ca-certificates/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: unkin-ca-certificates +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "ca-certificates for the unkin site" +description: "${PACKAGE_DESCRIPTION}" -maintainer: Unkin -homepage: https://vault.query.consul:8200 -license: Apache-2.0 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/unkin-undionly-kpxe/metadata.yaml b/rpms/unkin-undionly-kpxe/metadata.yaml index 97d809d..a40b3de 100644 --- a/rpms/unkin-undionly-kpxe/metadata.yaml +++ b/rpms/unkin-undionly-kpxe/metadata.yaml @@ -1,8 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 20250712.0.2 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 20250712.0.2 +description: iPXE network bootloader +github: ipxe/ipxe +homepage: https://github.com/ipxe/ipxe +license: GPL-2.0 license +maintainer: iPXE name: unkin-undionly-kpxe -release: 1 -version: 20250712.0.2 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +platform: linux diff --git a/rpms/unkin-undionly-kpxe/resources/build.sh b/rpms/unkin-undionly-kpxe/resources/build.sh index f447718..d19e224 100755 --- a/rpms/unkin-undionly-kpxe/resources/build.sh +++ b/rpms/unkin-undionly-kpxe/resources/build.sh @@ -1,4 +1,6 @@ #!/usr/bin/bash +set -e + # clone the repo git clone https://github.com/ipxe/ipxe.git @@ -16,5 +18,8 @@ make bin-x86_64-efi/ipxe.efi EMBED=main.ipxe cp bin/undionly.kpxe /app/ cp bin-x86_64-efi/ipxe.efi /app/ +# Process nfpm.yaml with envsubst +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + # build rpm -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm diff --git a/rpms/unkin-undionly-kpxe/resources/nfpm.yaml b/rpms/unkin-undionly-kpxe/resources/nfpm.yaml index 4cdfe78..9676165 100644 --- a/rpms/unkin-undionly-kpxe/resources/nfpm.yaml +++ b/rpms/unkin-undionly-kpxe/resources/nfpm.yaml @@ -1,16 +1,16 @@ # nfpm.yaml -name: unkin-undionly-kpxe +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "iPXE network bootloader" -maintainer: iPXE -homepage: https://github.com/ipxe/ipxe -license: GPL-2.0 license +description: "${PACKAGE_DESCRIPTION}" +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/unrar/metadata.yaml b/rpms/unrar/metadata.yaml index 5e47ab7..5bcfcc1 100644 --- a/rpms/unrar/metadata.yaml +++ b/rpms/unrar/metadata.yaml @@ -1,8 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 7.11.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 7.11.0 +description: WinRAR is a powerful archive manager. It can backup your data and reduce the size of email attachments, open and unpack RAR, ZIP and other files downloaded from Internet, create new archives in RAR and ZIP file format. +github: unknown/unrar +homepage: https://www.rarlab.com/ +license: Freeware (UNRAR 7.11 freeware Copyright (c) 1993-2025 Alexander Roshal) +maintainer: RARLAB name: unrar -release: 1 -version: 7.11.0 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +platform: linux diff --git a/rpms/unrar/resources/build.sh b/rpms/unrar/resources/build.sh index d8f2484..b21599c 100755 --- a/rpms/unrar/resources/build.sh +++ b/rpms/unrar/resources/build.sh @@ -1,10 +1,14 @@ #!/usr/bin/bash +set -e + # Download and extract unrar (with version formatting) export DOWNLOAD_VERSION=$(echo $PACKAGE_VERSION | sed s/\\.//) -curl -o /app/rarlinux.tar.gz https://www.rarlab.com/rar/rarlinux-x64-${DOWNLOAD_VERSION}.tar.gz +curl -L -o /app/rarlinux.tar.gz https://www.rarlab.com/rar/rarlinux-x64-${DOWNLOAD_VERSION}.tar.gz tar xf /app/rarlinux.tar.gz mv /app/rar/unrar /app/ -# Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/unrar/resources/nfpm.yaml b/rpms/unrar/resources/nfpm.yaml index 18bab6d..6720fb7 100644 --- a/rpms/unrar/resources/nfpm.yaml +++ b/rpms/unrar/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: unrar +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "WinRAR is a powerful archive manager. It can backup your data and reduce the size of email attachments, open and unpack RAR, ZIP and other files downloaded from Internet, create new archives in RAR and ZIP file format." +description: "${PACKAGE_DESCRIPTION}" -maintainer: RARLAB -homepage: https://www.rarlab.com/ -license: Freeware (UNRAR 7.11 freeware Copyright (c) 1993-2025 Alexander Roshal) +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/uv/metadata.yaml b/rpms/uv/metadata.yaml index 5fd5480..a5b49f6 100644 --- a/rpms/uv/metadata.yaml +++ b/rpms/uv/metadata.yaml @@ -1,9 +1,18 @@ -name: uv -release: 1 -version: 0.6.5 -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: 0.6.5 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.6.5 +description: An extremely fast Python package and project manager, written in Rust. github: astral-sh/uv +homepage: https://docs.astral.sh/uv/ +license: Apache-2.0 +maintainer: Astral.sh +name: uv +platform: linux diff --git a/rpms/uv/resources/build.sh b/rpms/uv/resources/build.sh index 3c47ecc..cd1e6b9 100755 --- a/rpms/uv/resources/build.sh +++ b/rpms/uv/resources/build.sh @@ -1,9 +1,14 @@ #!/usr/bin/bash +set -e + # Download and extract uv wget -O /app/uv-x86_64-unknown-linux-gnu.tar.gz https://github.com/astral-sh/uv/releases/download/${PACKAGE_VERSION}/uv-x86_64-unknown-linux-gnu.tar.gz tar xf /app/uv-x86_64-unknown-linux-gnu.tar.gz mv /app/uv-x86_64-unknown-linux-gnu/* /app/ +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + # Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/uv/resources/nfpm.yaml b/rpms/uv/resources/nfpm.yaml index 61037ce..948dd45 100644 --- a/rpms/uv/resources/nfpm.yaml +++ b/rpms/uv/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: uv +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "An extremely fast Python package and project manager, written in Rust." +description: "${PACKAGE_DESCRIPTION}" -maintainer: Astral.sh -homepage: https://docs.astral.sh/uv/ -license: Apache-2.0 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/vals/metadata.yaml b/rpms/vals/metadata.yaml index 7a3c652..87c4cc9 100644 --- a/rpms/vals/metadata.yaml +++ b/rpms/vals/metadata.yaml @@ -1,9 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 0.42.2 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 0.42.2 +description: vals is a Helm-like configuration 'Values' loader with support for various sources and merge strategies +github: helmfile/vals +homepage: https://github.com/helmfile/vals +license: Apache-2.0 +maintainer: Helmfile Contributors name: vals -release: 1 -version: 0.42.2 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest -github: helmfile/vals \ No newline at end of file +platform: linux diff --git a/rpms/vals/resources/build.sh b/rpms/vals/resources/build.sh index 1799a31..6884d7a 100755 --- a/rpms/vals/resources/build.sh +++ b/rpms/vals/resources/build.sh @@ -1,5 +1,7 @@ #!/usr/bin/bash +set -e + # Download the required files curl -L -o /app/vals.tar.gz https://github.com/helmfile/vals/releases/download/v${PACKAGE_VERSION}/vals_${PACKAGE_VERSION}_linux_amd64.tar.gz @@ -10,5 +12,7 @@ tar -xzf vals.tar.gz # Make the binary executable chmod +x /app/vals -# Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/vals/resources/nfpm.yaml b/rpms/vals/resources/nfpm.yaml index 4593dab..101772b 100644 --- a/rpms/vals/resources/nfpm.yaml +++ b/rpms/vals/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: vals +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra description: "vals is a Helm-like configuration 'Values' loader with support for various sources and merge strategies" -maintainer: Helmfile Contributors -homepage: https://github.com/helmfile/vals -license: Apache-2.0 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/vault/metadata.yaml b/rpms/vault/metadata.yaml index 4b3d2e2..75a6014 100644 --- a/rpms/vault/metadata.yaml +++ b/rpms/vault/metadata.yaml @@ -1,8 +1,18 @@ +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 1.19.5 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.19.5 +description: Vault is a tool for securely accessing secrets. A secret is anything that you want to tightly control access to, such as API keys, passwords, certificates, and more. Vault provides a unified interface to any secret, while providing tight access control and recording a detailed audit log. +github: hashicorp/vault +homepage: https://github.com/hashicorp/vault +license: BUSL-1.1 +maintainer: HashiCorp name: vault -release: 1 -version: 1.19.5 -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +platform: linux diff --git a/rpms/vault/resources/build.sh b/rpms/vault/resources/build.sh index 69d2a44..6e81b20 100755 --- a/rpms/vault/resources/build.sh +++ b/rpms/vault/resources/build.sh @@ -1,11 +1,16 @@ #!/usr/bin/bash +set -e + # Install dependencies dnf install -y unzip # Download and extract vault -curl -o /app/vault.zip https://releases.hashicorp.com/vault/${PACKAGE_VERSION}/vault_${PACKAGE_VERSION}_linux_amd64.zip +curl -L -o /app/vault.zip https://releases.hashicorp.com/vault/${PACKAGE_VERSION}/vault_${PACKAGE_VERSION}_linux_amd64.zip unzip vault.zip +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + # Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/vault/resources/nfpm.yaml b/rpms/vault/resources/nfpm.yaml index 019b87c..402d259 100644 --- a/rpms/vault/resources/nfpm.yaml +++ b/rpms/vault/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: vault +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "Vault is a tool for securely accessing secrets. A secret is anything that you want to tightly control access to, such as API keys, passwords, certificates, and more. Vault provides a unified interface to any secret, while providing tight access control and recording a detailed audit log." +description: "${PACKAGE_DESCRIPTION}" -maintainer: HashiCorp -homepage: https://github.com/hashicorp/vault -license: BUSL-1.1 +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/victoria-logs/metadata.yaml b/rpms/victoria-logs/metadata.yaml index 7792bb6..1145257 100644 --- a/rpms/victoria-logs/metadata.yaml +++ b/rpms/victoria-logs/metadata.yaml @@ -1,9 +1,18 @@ -name: victoria-logs -release: 1 -version: 1.26.0 +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 1.26.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.26.0 +description: 'VictoriaLogs: Fast and easy to use database for logs, which can efficiently handle terabytes of logs' github: VictoriaMetrics/VictoriaLogs -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +homepage: https://github.com/VictoriaMetrics/VictoriaLogs +license: Apache-2.0 license +maintainer: VictoriaMetrics +name: victoria-logs +platform: linux diff --git a/rpms/victoria-logs/resources/build.sh b/rpms/victoria-logs/resources/build.sh index 7f4a794..c5a8c7b 100755 --- a/rpms/victoria-logs/resources/build.sh +++ b/rpms/victoria-logs/resources/build.sh @@ -1,9 +1,13 @@ #!/usr/bin/bash +set -e + # Download and extract victoria-logs -curl -o /app/victoria-logs-linux-amd64-v${PACKAGE_VERSION}.tar.gz \ +curl -L -o /app/victoria-logs-linux-amd64-v${PACKAGE_VERSION}.tar.gz \ https://github.com/VictoriaMetrics/VictoriaLogs/releases/download/v${PACKAGE_VERSION}/victoria-logs-linux-amd64-v${PACKAGE_VERSION}.tar.gz tar xf victoria-logs-linux-amd64-v${PACKAGE_VERSION}.tar.gz -# Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/victoria-logs/resources/nfpm.yaml b/rpms/victoria-logs/resources/nfpm.yaml index ad8f552..b35e8f3 100644 --- a/rpms/victoria-logs/resources/nfpm.yaml +++ b/rpms/victoria-logs/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: victoria-logs +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "VictoriaLogs: Fast and easy to use database for logs, which can efficiently handle terabytes of logs " +description: "${PACKAGE_DESCRIPTION}" -maintainer: VictoriaMetrics -homepage: https://github.com/VictoriaMetrics/VictoriaLogs -license: Apache-2.0 license +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/vlutils/metadata.yaml b/rpms/vlutils/metadata.yaml index 0603a8f..e094227 100644 --- a/rpms/vlutils/metadata.yaml +++ b/rpms/vlutils/metadata.yaml @@ -1,9 +1,18 @@ -name: vlutils -release: 1 -version: 1.26.0 +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 1.26.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.26.0 +description: 'VictoriaLogs utilities: Fast and easy to use database for logs, which can efficiently handle terabytes of logs' github: VictoriaMetrics/VictoriaLogs -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +homepage: https://github.com/VictoriaMetrics/VictoriaLogs +license: Apache-2.0 license +maintainer: VictoriaMetrics +name: vlutils +platform: linux diff --git a/rpms/vlutils/resources/build.sh b/rpms/vlutils/resources/build.sh index a0d1945..0132cc1 100755 --- a/rpms/vlutils/resources/build.sh +++ b/rpms/vlutils/resources/build.sh @@ -1,9 +1,13 @@ #!/usr/bin/bash +set -e + # Download and extract vlutils -curl -o /app/vlutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz \ +curl -L -o /app/vlutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz \ https://github.com/VictoriaMetrics/VictoriaLogs/releases/download/v${PACKAGE_VERSION}/vlutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz tar xf vlutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz -# Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/vlutils/resources/nfpm.yaml b/rpms/vlutils/resources/nfpm.yaml index 21def45..7516ad6 100644 --- a/rpms/vlutils/resources/nfpm.yaml +++ b/rpms/vlutils/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: vlutils +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "VictoriaLogs utilities: Fast and easy to use database for logs, which can efficiently handle terabytes of logs " +description: "${PACKAGE_DESCRIPTION}" -maintainer: VictoriaMetrics -homepage: https://github.com/VictoriaMetrics/VictoriaLogs -license: Apache-2.0 license +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/vmagent/metadata.yaml b/rpms/vmagent/metadata.yaml index aa3f32e..15ca088 100644 --- a/rpms/vmagent/metadata.yaml +++ b/rpms/vmagent/metadata.yaml @@ -1,9 +1,18 @@ -name: vmagent -release: 1 -version: 1.119.0 +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 1.119.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.119.0 +description: vmagent collects metrics data via popular data ingestion protocols and routes it to VictoriaMetrics. github: VictoriaMetrics/VictoriaMetrics -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +homepage: https://github.com/VictoriaMetrics/VictoriaMetrics +license: Apache-2.0 license +maintainer: VictoriaMetrics +name: vmagent +platform: linux diff --git a/rpms/vmagent/resources/build.sh b/rpms/vmagent/resources/build.sh index 689d647..fece99a 100755 --- a/rpms/vmagent/resources/build.sh +++ b/rpms/vmagent/resources/build.sh @@ -1,7 +1,12 @@ #!/usr/bin/bash +set -e + # Download the required files -curl -o /app/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz +curl -L -o /app/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz tar xf vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm diff --git a/rpms/vmagent/resources/nfpm.yaml b/rpms/vmagent/resources/nfpm.yaml index 0d64fd7..2ab2571 100644 --- a/rpms/vmagent/resources/nfpm.yaml +++ b/rpms/vmagent/resources/nfpm.yaml @@ -1,16 +1,16 @@ # nfpm.yaml -name: vmagent +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "vmagent collects metrics data via popular data ingestion protocols and routes it to VictoriaMetrics." -maintainer: VictoriaMetrics -homepage: https://github.com/VictoriaMetrics/VictoriaMetrics -license: Apache-2.0 license +description: "${PACKAGE_DESCRIPTION}" +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/vmalert/metadata.yaml b/rpms/vmalert/metadata.yaml index 27ae48c..4ee39e0 100644 --- a/rpms/vmalert/metadata.yaml +++ b/rpms/vmalert/metadata.yaml @@ -1,9 +1,18 @@ -name: vmalert -release: 1 -version: 1.119.0 +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 1.119.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.119.0 +description: vmalert processes alerts and recording rules from VictoriaMetrics. github: VictoriaMetrics/VictoriaMetrics -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +homepage: https://github.com/VictoriaMetrics/VictoriaMetrics +license: Apache-2.0 license +maintainer: VictoriaMetrics +name: vmalert +platform: linux diff --git a/rpms/vmalert/resources/build.sh b/rpms/vmalert/resources/build.sh index 689d647..fece99a 100755 --- a/rpms/vmalert/resources/build.sh +++ b/rpms/vmalert/resources/build.sh @@ -1,7 +1,12 @@ #!/usr/bin/bash +set -e + # Download the required files -curl -o /app/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz +curl -L -o /app/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz tar xf vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm diff --git a/rpms/vmalert/resources/nfpm.yaml b/rpms/vmalert/resources/nfpm.yaml index f41e0db..b680851 100644 --- a/rpms/vmalert/resources/nfpm.yaml +++ b/rpms/vmalert/resources/nfpm.yaml @@ -1,16 +1,16 @@ # nfpm.yaml -name: vmalert +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "vmalert processes alerts and recording rules from VictoriaMetrics." -maintainer: VictoriaMetrics -homepage: https://github.com/VictoriaMetrics/VictoriaMetrics -license: Apache-2.0 license +description: "${PACKAGE_DESCRIPTION}" +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/vminsert/metadata.yaml b/rpms/vminsert/metadata.yaml index 7056b16..998b032 100644 --- a/rpms/vminsert/metadata.yaml +++ b/rpms/vminsert/metadata.yaml @@ -1,9 +1,18 @@ -name: vminsert -release: 1 -version: 1.119.0 +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 1.119.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.119.0 +description: vminsert accepts data via popular data ingestion protocols and routes it to vmstorage nodes github: VictoriaMetrics/VictoriaMetrics -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +homepage: https://github.com/VictoriaMetrics/VictoriaMetrics +license: Apache-2.0 license +maintainer: VictoriaMetrics +name: vminsert +platform: linux diff --git a/rpms/vminsert/resources/build.sh b/rpms/vminsert/resources/build.sh index 8988c7a..f65b3bf 100755 --- a/rpms/vminsert/resources/build.sh +++ b/rpms/vminsert/resources/build.sh @@ -1,7 +1,12 @@ #!/usr/bin/bash +set -e + # Download the required files -curl -o /app/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz +curl -L -o /app/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz tar xf victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm diff --git a/rpms/vminsert/resources/nfpm.yaml b/rpms/vminsert/resources/nfpm.yaml index e14f59a..10644b5 100644 --- a/rpms/vminsert/resources/nfpm.yaml +++ b/rpms/vminsert/resources/nfpm.yaml @@ -1,16 +1,16 @@ # nfpm.yaml -name: vminsert +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "vminsert accepts data via popular data ingestion protocols and routes it to vmstorage nodes" -maintainer: VictoriaMetrics -homepage: https://github.com/VictoriaMetrics/VictoriaMetrics -license: Apache-2.0 license +description: "${PACKAGE_DESCRIPTION}" +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/vmselect/metadata.yaml b/rpms/vmselect/metadata.yaml index b22d0b6..ed315cb 100644 --- a/rpms/vmselect/metadata.yaml +++ b/rpms/vmselect/metadata.yaml @@ -1,9 +1,18 @@ -name: vmselect -release: 1 -version: 1.119.0 +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 1.119.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.119.0 +description: vmselect processes incoming queries by fetching the requested data from vmstorage nodes github: VictoriaMetrics/VictoriaMetrics -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +homepage: https://github.com/VictoriaMetrics/VictoriaMetrics +license: Apache-2.0 license +maintainer: VictoriaMetrics +name: vmselect +platform: linux diff --git a/rpms/vmselect/resources/build.sh b/rpms/vmselect/resources/build.sh index 8988c7a..9fb7682 100755 --- a/rpms/vmselect/resources/build.sh +++ b/rpms/vmselect/resources/build.sh @@ -1,7 +1,12 @@ #!/usr/bin/bash -# Download the required files -curl -o /app/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz -tar xf victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz +set -e -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm +# Download the required files +curl -L -o /app/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz +tar -xf /app/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz -C /app + +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm diff --git a/rpms/vmselect/resources/nfpm.yaml b/rpms/vmselect/resources/nfpm.yaml index 23d5f56..7daf2f8 100644 --- a/rpms/vmselect/resources/nfpm.yaml +++ b/rpms/vmselect/resources/nfpm.yaml @@ -1,16 +1,16 @@ # nfpm.yaml -name: vmselect +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "vmselect processes incoming queries by fetching the requested data from vmstorage nodes" -maintainer: VictoriaMetrics -homepage: https://github.com/VictoriaMetrics/VictoriaMetrics -license: Apache-2.0 license +description: "${PACKAGE_DESCRIPTION}" +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/vmstorage/metadata.yaml b/rpms/vmstorage/metadata.yaml index 5ce32bd..a09c416 100644 --- a/rpms/vmstorage/metadata.yaml +++ b/rpms/vmstorage/metadata.yaml @@ -1,9 +1,18 @@ -name: vmstorage -release: 1 -version: 1.119.0 +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 1.119.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.119.0 +description: vmstorage stores time series data obtained from vminsert and returns the requested data to vmselect github: VictoriaMetrics/VictoriaMetrics -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +homepage: https://github.com/VictoriaMetrics/VictoriaMetrics +license: Apache-2.0 license +maintainer: VictoriaMetrics +name: vmstorage +platform: linux diff --git a/rpms/vmstorage/resources/build.sh b/rpms/vmstorage/resources/build.sh index 8988c7a..f65b3bf 100755 --- a/rpms/vmstorage/resources/build.sh +++ b/rpms/vmstorage/resources/build.sh @@ -1,7 +1,12 @@ #!/usr/bin/bash +set -e + # Download the required files -curl -o /app/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz +curl -L -o /app/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz tar xf victoria-metrics-linux-amd64-v${PACKAGE_VERSION}-cluster.tar.gz -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm diff --git a/rpms/vmstorage/resources/nfpm.yaml b/rpms/vmstorage/resources/nfpm.yaml index 695d5d9..4914447 100644 --- a/rpms/vmstorage/resources/nfpm.yaml +++ b/rpms/vmstorage/resources/nfpm.yaml @@ -1,16 +1,16 @@ # nfpm.yaml -name: vmstorage +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "vmstorage stores time series data obtained from vminsert and returns the requested data to vmselect" -maintainer: VictoriaMetrics -homepage: https://github.com/VictoriaMetrics/VictoriaMetrics -license: Apache-2.0 license +description: "${PACKAGE_DESCRIPTION}" +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/rpms/vmutils/metadata.yaml b/rpms/vmutils/metadata.yaml index 93d0ae1..ff80163 100644 --- a/rpms/vmutils/metadata.yaml +++ b/rpms/vmutils/metadata.yaml @@ -1,9 +1,18 @@ -name: vmutils -release: 1 -version: 1.119.0 +--- +arch: amd64 +builds: + - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest + release: '1' + repository: [almalinux/el8] + version: 1.119.0 + - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: '1' + repository: [almalinux/el9] + version: 1.119.0 +description: 'VictoriaMetrics utilities: fast, cost-effective monitoring solution and time series database.' github: VictoriaMetrics/VictoriaMetrics -build: -- distro: el/8 - image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest -- distro: el/9 - image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest +homepage: https://github.com/VictoriaMetrics/VictoriaMetrics +license: Apache-2.0 license +maintainer: VictoriaMetrics +name: vmutils +platform: linux diff --git a/rpms/vmutils/resources/build.sh b/rpms/vmutils/resources/build.sh index 8cd37a2..902375e 100755 --- a/rpms/vmutils/resources/build.sh +++ b/rpms/vmutils/resources/build.sh @@ -1,9 +1,13 @@ #!/usr/bin/bash +set -e + # Download and extract vmutils -curl -o /app/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz \ +curl -L -o /app/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz \ https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v${PACKAGE_VERSION}/vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz tar xf vmutils-linux-amd64-v${PACKAGE_VERSION}.tar.gz -# Build the RPM -nfpm pkg --config /app/resources/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file +# Process the nfpm.yaml template with environment variables +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm \ No newline at end of file diff --git a/rpms/vmutils/resources/nfpm.yaml b/rpms/vmutils/resources/nfpm.yaml index 2527d29..fe4129c 100644 --- a/rpms/vmutils/resources/nfpm.yaml +++ b/rpms/vmutils/resources/nfpm.yaml @@ -1,17 +1,17 @@ # nfpm.yaml -name: vmutils +name: ${PACKAGE_NAME} version: ${PACKAGE_VERSION} release: ${PACKAGE_RELEASE} -arch: amd64 -platform: linux +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} section: default priority: extra -description: "VictoriaMetrics utilities: fast, cost-effective monitoring solution and time series database." +description: "${PACKAGE_DESCRIPTION}" -maintainer: VictoriaMetrics -homepage: https://github.com/VictoriaMetrics/VictoriaMetrics -license: Apache-2.0 license +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} disable_globbing: false diff --git a/tools/build b/tools/build index 26946ac..09db6b6 100755 --- a/tools/build +++ b/tools/build @@ -1,9 +1,11 @@ #!/usr/bin/env -S uv run --script # /// script # dependencies = [ +# "typer", # "requests", # "pyyaml", -# "hvac" +# "hvac", +# "cerberus" # ] # /// @@ -12,22 +14,139 @@ """ RPM Builder Tool -A Python replacement for the Makefile-based build system. +A modern Python console application for building RPM packages. Builds RPM packages using Docker and checks for existing packages via Gitea API. """ import os import sys -import argparse import logging import subprocess import requests from pathlib import Path -from typing import List, Tuple +from typing import List, Optional from concurrent.futures import ThreadPoolExecutor, as_completed +from dataclasses import dataclass import hvac +import typer +import yaml +from cerberus import Validator +# ==================== VALIDATION SCHEMA ==================== + +# Cerberus schema for metadata.yaml validation based on PackageMetadata and Build dataclasses +METADATA_SCHEMA = { + 'name': { + 'type': 'string', + 'required': True, + 'empty': False, + 'regex': r'^[a-zA-Z0-9][a-zA-Z0-9\-_]*$' + }, + 'github': { + 'type': 'string', + 'required': True, + 'empty': False, + 'regex': r'^[a-zA-Z0-9\-_]+/[a-zA-Z0-9\-_\.]+$' + }, + 'description': { + 'type': 'string', + 'required': True, + 'empty': False + }, + 'arch': { + 'type': 'string', + 'required': False, + 'default': 'amd64', + 'allowed': ['amd64', 'arm64', 'x86_64'] + }, + 'platform': { + 'type': 'string', + 'required': False, + 'default': 'linux' + }, + 'maintainer': { + 'type': 'string', + 'required': False, + 'empty': False + }, + 'homepage': { + 'type': 'string', + 'required': False, + 'empty': False, + 'regex': r'^https?://.+' + }, + 'license': { + 'type': 'string', + 'required': False, + 'empty': False + }, + 'builds': { + 'type': 'list', + 'required': True, + 'minlength': 1, + 'schema': { + 'type': 'dict', + 'schema': { + 'repository': { + 'type': 'list', + 'required': True, + 'minlength': 1, + 'schema': { + 'type': 'string', + 'allowed': ['almalinux/el8', 'almalinux/el9'], + 'empty': False + } + }, + 'image': { + 'type': 'string', + 'required': True, + 'empty': False, + 'regex': r'^[a-zA-Z0-9\-_\.:\/]+$' + }, + 'release': { + 'type': 'string', + 'required': True, + 'empty': False + }, + 'version': { + 'type': 'string', + 'required': True, + 'empty': False, + 'regex': r'^[0-9]+(\.[0-9]+)*(\.[0-9]+)*(-[a-zA-Z0-9]+)*$' + } + } + } + } +} + +# ==================== DATACLASSES ====================" + +@dataclass +class Build: + """Describes each build of a package that should be managed.""" + repository: List[str] + image: str + release: str + version: str + +@dataclass +class PackageMetadata: + """Defines data that will be used to fill nfpm.yaml variables and contains build objects.""" + name: str + github: str + description: str + arch: str = "amd64" + platform: str = "linux" + maintainer: str = "" + homepage: str = "" + license: str = "" + builds: List[Build] = None + + def __post_init__(self): + if self.builds is None: + self.builds = [] + # ==================== VAULT FUNCTIONS ==================== def get_vault_client() -> hvac.Client: @@ -45,7 +164,7 @@ def get_vault_client() -> hvac.Client: if not vault_role_id: logger.error("VAULT_ROLE_ID environment variable is required") - raise ValueError("VAULT_ROLE_ID environment variable is required") + sys.exit(1) # Initialize Vault client with CA certificate client = hvac.Client( @@ -56,49 +175,37 @@ def get_vault_client() -> hvac.Client: # Authenticate using AppRole try: logger.debug(f"Authenticating to Vault at {vault_addr}") - auth_response = client.auth.approle.login(role_id=vault_role_id) + client.auth.approle.login(role_id=vault_role_id) if not client.is_authenticated(): logger.error("Failed to authenticate with Vault") - raise Exception("Failed to authenticate with Vault") + sys.exit(1) logger.debug("Successfully authenticated with Vault") return client except Exception as e: logger.error(f"Vault authentication failed: {e}") - raise + sys.exit(1) -def get_api_tokens() -> Tuple[str, str]: +def get_gitea_token() -> str: """ - Retrieve GitHub and Gitea API tokens from Vault. + Retrieve Gitea API token from Vault. Returns: - Tuple of (github_token, gitea_token) + Gitea API token Raises: - Exception if Vault authentication fails or tokens cannot be retrieved + Exception if Vault authentication fails or token cannot be retrieved """ logger = logging.getLogger(__name__) client = get_vault_client() - # Read GitHub token - try: - github_secret = client.secrets.kv.v2.read_secret_version( - mount_point='kv', - path='service/github/neoloc/tokens/read-only-token' - ) - github_token = github_secret['data']['data']['token'] - logger.debug("Successfully retrieved GitHub token from Vault") - except Exception as e: - logger.error(f"Failed to retrieve GitHub token from Vault: {e}") - raise Exception(f"Failed to retrieve GitHub token from Vault: {e}") - - # Read Gitea token try: gitea_secret = client.secrets.kv.v2.read_secret_version( + raise_on_deleted_version=True, mount_point='kv', path='service/gitea/unkinben/tokens/read-only-packages' ) @@ -106,13 +213,13 @@ def get_api_tokens() -> Tuple[str, str]: logger.debug("Successfully retrieved Gitea token from Vault") except Exception as e: logger.error(f"Failed to retrieve Gitea token from Vault: {e}") - raise Exception(f"Failed to retrieve Gitea token from Vault: {e}") + sys.exit(1) - if not github_token or not gitea_token: - logger.error("One or both API tokens are empty") - raise Exception("One or both API tokens are empty") + if not gitea_token: + logger.error("Gitea token is empty") + sys.exit(1) - return github_token, gitea_token + return gitea_token # ==================== GITEA API FUNCTIONS ==================== @@ -169,12 +276,8 @@ def check_package_exists(package_name: str, version: str, release: str) -> bool: owner = os.getenv('GITEA_OWNER', 'unkin') package_type = os.getenv('GITEA_PACKAGE_TYPE', 'rpm') - # Get API tokens from Vault - fail hard if unavailable - try: - _, gitea_token = get_api_tokens() - except Exception as e: - logger.error(f"Failed to retrieve API tokens from Vault: {e}") - raise Exception(f"Cannot check package existence without Gitea API token: {e}") + # Get Gitea token from Vault - fail hard if unavailable + gitea_token = get_gitea_token() try: # Normalize version by removing leading zeros (Gitea does this automatically) @@ -285,11 +388,10 @@ def get_base_image_from_metadata(package_dir: Path, distro: str = "el/9") -> str return default_image try: - import yaml with open(metadata_file, 'r') as f: metadata = yaml.safe_load(f) - build_configs = metadata.get('build', []) + build_configs = metadata.get('builds', []) for config in build_configs: if config.get('distro') == distro: return config.get('image', default_image) @@ -340,23 +442,50 @@ def build_package_docker( image_name = f"{package_name.lower()}-builder" container_name = f"{package_name}-{package_version}-builder" + # Read metadata.yaml to get all package fields + metadata_file = package_dir / "metadata.yaml" + metadata = {} + if metadata_file.exists(): + try: + with open(metadata_file, 'r') as f: + metadata = yaml.safe_load(f) or {} + except Exception as e: + logger.warning(f"Could not read metadata.yaml: {e}") + logger.info(f"Building RPM for {package_name} version {package_version}") if dry_run: logger.info(f"[DRY RUN] Would build Docker image: {image_name}") logger.info(f"[DRY RUN] Would use base image: {base_image}") + logger.info(f"[DRY RUN] Would pass build arguments:") + logger.info(f"[DRY RUN] PACKAGE_NAME={package_name}") + logger.info(f"[DRY RUN] PACKAGE_VERSION={package_version}") + logger.info(f"[DRY RUN] PACKAGE_RELEASE={package_release}") + logger.info(f"[DRY RUN] PACKAGE_DESCRIPTION={metadata.get('description', '')}") + logger.info(f"[DRY RUN] PACKAGE_MAINTAINER={metadata.get('maintainer', '')}") + logger.info(f"[DRY RUN] PACKAGE_HOMEPAGE={metadata.get('homepage', '')}") + logger.info(f"[DRY RUN] PACKAGE_LICENSE={metadata.get('license', '')}") + logger.info(f"[DRY RUN] PACKAGE_ARCH={metadata.get('arch', 'amd64')}") + logger.info(f"[DRY RUN] PACKAGE_PLATFORM={metadata.get('platform', 'linux')}") logger.info(f"[DRY RUN] Would create container: {container_name}") logger.info(f"[DRY RUN] Would copy artifacts to: {package_dist_dir}") return True - # Step 1: Build Docker image using central Dockerfile + # Build Docker image using central Dockerfile with all metadata central_dockerfile = package_dir.parent.parent / "Dockerfile" build_args = [ 'docker', 'build', '-f', str(central_dockerfile), '--build-arg', f'BASE_IMAGE={base_image}', + '--build-arg', f'PACKAGE_NAME={package_name}', '--build-arg', f'PACKAGE_VERSION={package_version}', '--build-arg', f'PACKAGE_RELEASE={package_release}', + '--build-arg', f'PACKAGE_DESCRIPTION={metadata.get("description", "")}', + '--build-arg', f'PACKAGE_MAINTAINER={metadata.get("maintainer", "")}', + '--build-arg', f'PACKAGE_HOMEPAGE={metadata.get("homepage", "")}', + '--build-arg', f'PACKAGE_LICENSE={metadata.get("license", "")}', + '--build-arg', f'PACKAGE_ARCH={metadata.get("arch", "amd64")}', + '--build-arg', f'PACKAGE_PLATFORM={metadata.get("platform", "linux")}', '-t', image_name, str(package_dir) ] @@ -454,16 +583,15 @@ def cleanup_images(image_pattern: str = "*-builder") -> None: # ==================== PACKAGE INFO CLASS ==================== +@dataclass class PackageInfo: """Information about a package to build.""" - - def __init__(self, name: str, version: str, release: str, directory: Path, distro: str = 'el/9', base_image: str = None): - self.name = name - self.version = version - self.release = release - self.directory = directory - self.distro = distro - self.base_image = base_image or "git.unkin.net/unkin/almalinux9-rpmbuilder:latest" + name: str + version: str + release: str + directory: Path + distro: str = 'almalinux/el9' + base_image: str = "git.unkin.net/unkin/almalinux9-rpmbuilder:latest" def __str__(self): return f"{self.name}-{self.version}-{self.release} ({self.distro})" @@ -490,12 +618,12 @@ class Builder: # Ensure dist directory exists self.dist_dir.mkdir(exist_ok=True) - def discover_packages(self, distro: str = 'el/9') -> List[PackageInfo]: + def discover_packages(self, distro: str = 'almalinux/el9') -> List[PackageInfo]: """ Discover all packages and their versions from metadata.yaml files. Args: - distro: Target distro (e.g., 'el/8', 'el/9', 'all') + distro: Target distro (e.g., 'almalinux/el8', 'almalinux/el9', 'all') Returns: List of PackageInfo objects @@ -516,21 +644,14 @@ class Builder: continue try: - import yaml with open(metadata_file, 'r') as f: metadata = yaml.safe_load(f) package_name = metadata.get('name', package_dir.name) - version = metadata.get('version') - release = metadata.get('release') - build_configs = metadata.get('build', []) + build_configs = metadata.get('builds', []) - if not version: - self.logger.warning(f"No version in metadata.yaml for {package_name}") - continue - - if not release: - self.logger.warning(f"No release in metadata.yaml for {package_name}") + if not build_configs: + self.logger.warning(f"No builds in metadata.yaml for {package_name}") continue # Handle distro filtering @@ -538,16 +659,26 @@ class Builder: # Build for all configured distros for build_config in build_configs: if isinstance(build_config, dict): - build_distro = build_config.get('distro') + repositories = build_config.get('repository', []) base_image = build_config.get('image') - if build_distro and base_image: + version = build_config.get('version') + release = build_config.get('release') + + if repositories and base_image and version and release: + # Use the first repository as the distro identifier + build_distro = repositories[0] if repositories else 'unknown' packages.append(PackageInfo(package_name, version, str(release), package_dir, build_distro, base_image)) else: # Build for specific distro for build_config in build_configs: - if isinstance(build_config, dict) and build_config.get('distro') == distro: + if isinstance(build_config, dict): + repositories = build_config.get('repository', []) base_image = build_config.get('image') - if base_image: + version = build_config.get('version') + release = build_config.get('release') + + # Check if the target distro matches any repository + if distro in repositories and base_image and version and release: packages.append(PackageInfo(package_name, version, str(release), package_dir, distro, base_image)) break else: @@ -567,7 +698,7 @@ class Builder: release: str, dry_run: bool = False, force: bool = False, - distro: str = 'el/9' + distro: str = 'almalinux/el9' ) -> bool: """ Build a single package. @@ -578,7 +709,7 @@ class Builder: release: Package release dry_run: If True, only show what would be done force: If True, build even if package exists - distro: Target distro (e.g., 'el/8', 'el/9', 'all') + distro: Target distro (e.g., 'almalinux/el8', 'almalinux/el9', 'all') Returns: True if build succeeded, False otherwise @@ -596,44 +727,48 @@ class Builder: return False try: - import yaml with open(metadata_file, 'r') as f: metadata = yaml.safe_load(f) - metadata_version = metadata.get('version') - metadata_release = metadata.get('release') - - if metadata_version != version: - self.logger.error( - f"Version mismatch for {package}: " - f"provided {version} but metadata.yaml has {metadata_version}" - ) - return False - - if str(metadata_release) != str(release): - self.logger.error( - f"Release mismatch for {package}: " - f"provided {release} but metadata.yaml has {metadata_release}" - ) - return False - - # Find base image for the specified distro - build_configs = metadata.get('build', []) + # Find base image and validate version/release for the specified distro + build_configs = metadata.get('builds', []) base_image = None + found_build = None if distro == 'all': - # For single package build, 'all' doesn't make sense, default to el/9 - distro = 'el/9' + # For single package build, 'all' doesn't make sense, default to almalinux/el9 + distro = 'almalinux/el9' for build_config in build_configs: - if isinstance(build_config, dict) and build_config.get('distro') == distro: - base_image = build_config.get('image') - break + if isinstance(build_config, dict): + repositories = build_config.get('repository', []) + if distro in repositories: + found_build = build_config + base_image = build_config.get('image') + break - if not base_image: + if not found_build or not base_image: self.logger.error(f"No build configuration found for distro {distro} in {package}") return False + # Check version and release match + build_version = found_build.get('version') + build_release = found_build.get('release') + + if build_version != version: + self.logger.error( + f"Version mismatch for {package} on {distro}: " + f"provided {version} but metadata.yaml has {build_version}" + ) + return False + + if str(build_release) != str(release): + self.logger.error( + f"Release mismatch for {package} on {distro}: " + f"provided {release} but metadata.yaml has {build_release}" + ) + return False + except Exception as e: self.logger.error(f"Error reading metadata.yaml for {package}: {e}") return False @@ -649,7 +784,7 @@ class Builder: dry_run: If True, only show what would be done force: If True, build even if packages exist parallel: Number of parallel builds - distro: Target distro (e.g., 'el/8', 'el/9', 'all') + distro: Target distro (e.g., 'almalinux/el8', 'almalinux/el9', 'all') Returns: True if all builds succeeded, False otherwise @@ -747,17 +882,6 @@ class Builder: self.logger.error(f"Failed to build {package_info}: {e}") return False - def list_packages(self) -> None: - """List all available packages.""" - packages = self.discover_packages() - - if not packages: - print("No packages found") - return - - print("Available packages:") - for package_info in sorted(packages, key=lambda p: (p.name, p.version)): - print(f" {package_info}") def clean_dist(self) -> None: """Clean the dist directory.""" @@ -768,9 +892,11 @@ class Builder: self.logger.info("Cleaned dist directory") -# ==================== MAIN FUNCTIONS ==================== +# ==================== TYPER APPLICATION ==================== -def setup_logging(verbose=False): +app = typer.Typer(help="Build RPM packages using Docker", no_args_is_help=True) + +def setup_logging(verbose: bool = False): """Set up logging configuration.""" level = logging.DEBUG if verbose else logging.INFO logging.basicConfig( @@ -779,113 +905,222 @@ def setup_logging(verbose=False): datefmt='%H:%M:%S' ) +@app.command() +def list_packages( + distro: str = typer.Option("almalinux/el9", help="Target distro to list packages for (default: almalinux/el9)") +): + """List all available packages.""" + setup_logging() + root_dir = Path(__file__).parent.parent + builder = Builder(root_dir) -def main(): - """Main entry point.""" - parser = argparse.ArgumentParser( - description='Build RPM packages using Docker', - formatter_class=argparse.RawDescriptionHelpFormatter, - epilog=""" -Examples: - %(prog)s --package consul --version 1.21.1 --release 1 - %(prog)s --package consul (uses version/release from metadata.yaml) - %(prog)s --package consul --distro el/8 (build for el/8) - %(prog)s --all (builds all packages for el/9 by default) - %(prog)s --all --distro el/8 (builds all packages for el/8) - %(prog)s --all --distro all (builds all packages for all distros) - %(prog)s --all --dry-run - """ - ) + packages = builder.discover_packages(distro) + if not packages: + typer.echo("No packages found") + return - # Package selection arguments - group = parser.add_mutually_exclusive_group(required=True) - group.add_argument('--package', help='Package name to build') - group.add_argument('--all', action='store_true', help='Build all packages') + typer.echo("Available packages:") + for package_info in sorted(packages, key=lambda p: (p.name, p.version)): + typer.echo(f" {package_info}") - # Version and release (optional for single package builds, read from metadata.yaml if not provided) - parser.add_argument('--version', help='Package version (optional, read from metadata.yaml if not provided)') - parser.add_argument('--release', help='Package release number (optional, read from metadata.yaml if not provided)') - - # Optional arguments - parser.add_argument('--distro', default='el/9', help='Build for specific distro (default: el/9). Use "all" to build for all distros.') - parser.add_argument('--dry-run', action='store_true', help='Show what would be built without building') - parser.add_argument('--force', action='store_true', help='Build even if package exists in registry') - parser.add_argument('--verbose', '-v', action='store_true', help='Enable verbose logging') - parser.add_argument('--parallel', type=int, default=4, help='Number of parallel builds (default: 4)') - - args = parser.parse_args() - - # No validation needed - version/release will be read from metadata.yaml if not provided - - setup_logging(args.verbose) +@app.command() +def build( + package_name: str = typer.Argument(..., help="Package name to build"), + version: Optional[str] = typer.Option(None, help="Package version (read from metadata.yaml if not provided)"), + release: Optional[str] = typer.Option(None, help="Package release number (read from metadata.yaml if not provided)"), + distro: str = typer.Option("almalinux/el9", help="Target distro (default: almalinux/el9)"), + dry_run: bool = typer.Option(False, "--dry-run", help="Show what would be built without building"), + force: bool = typer.Option(False, "--force", help="Build even if package exists in registry"), + verbose: bool = typer.Option(False, "--verbose", "-v", help="Enable verbose logging") +): + """Build a specific package.""" + setup_logging(verbose) try: - # Initialize components root_dir = Path(__file__).parent.parent builder = Builder(root_dir) - # Execute build - if args.all: - success = builder.build_all( - dry_run=args.dry_run, - force=args.force, - parallel=args.parallel, - distro=args.distro - ) - else: - # Read version/release from metadata.yaml if not provided - version = args.version - release = args.release + # Read version/release from metadata.yaml if not provided + if not version or not release: + package_dir = builder.rpms_dir / package_name + metadata_file = package_dir / "metadata.yaml" - if not version or not release: - package_dir = builder.rpms_dir / args.package - metadata_file = package_dir / "metadata.yaml" + if not metadata_file.exists(): + typer.echo(f"Error: metadata.yaml not found for package {package_name}", err=True) + raise typer.Exit(1) - if not metadata_file.exists(): - logging.error(f"metadata.yaml not found for package {args.package}") - sys.exit(1) + try: + with open(metadata_file, 'r') as f: + metadata = yaml.safe_load(f) - try: - import yaml - with open(metadata_file, 'r') as f: - metadata = yaml.safe_load(f) + # Version and release are now per-build, so we need to find a build for this distro + if not version or not release: + build_configs = metadata.get('builds', []) + + # Find the build for the current distro + found_build = None + for build_config in build_configs: + if isinstance(build_config, dict): + repositories = build_config.get('repository', []) + if distro in repositories: + found_build = build_config + break + + if not found_build: + typer.echo(f"Error: No build configuration found for {distro} in {package_name}", err=True) + raise typer.Exit(1) if not version: - version = metadata.get('version') + version = found_build.get('version') if not version: - logging.error(f"No version in metadata.yaml for {args.package}") - sys.exit(1) + typer.echo(f"Error: No version in build config for {distro} in {package_name}", err=True) + raise typer.Exit(1) if not release: - release = metadata.get('release') + release = found_build.get('release') if not release: - logging.error(f"No release in metadata.yaml for {args.package}") - sys.exit(1) + typer.echo(f"Error: No release in build config for {distro} in {package_name}", err=True) + raise typer.Exit(1) - except Exception as e: - logging.error(f"Error reading metadata.yaml for {args.package}: {e}") - sys.exit(1) + except Exception as e: + typer.echo(f"Error reading metadata.yaml for {package_name}: {e}", err=True) + raise typer.Exit(1) - success = builder.build_single( - package=args.package, - version=version, - release=str(release), - dry_run=args.dry_run, - force=args.force, - distro=args.distro - ) + success = builder.build_single( + package=package_name, + version=version, + release=str(release), + dry_run=dry_run, + force=force, + distro=distro + ) - sys.exit(0 if success else 1) + if not success: + raise typer.Exit(1) except KeyboardInterrupt: - logging.info("Build interrupted by user") - sys.exit(130) - except Exception as e: - logging.error(f"Build failed: {e}") - if args.verbose: - logging.exception("Full traceback:") - sys.exit(1) + typer.echo("Build interrupted by user") + raise typer.Exit(130) +@app.command("build-all") +def build_all( + dry_run: bool = typer.Option(False, "--dry-run", help="Show what would be built without building"), + force: bool = typer.Option(False, "--force", help="Build even if packages exist in registry"), + parallel: int = typer.Option(4, help="Number of parallel builds"), + distro: str = typer.Option("almalinux/el9", help="Target distro (almalinux/el8, almalinux/el9, or 'all' for all distros)"), + verbose: bool = typer.Option(False, "--verbose", "-v", help="Enable verbose logging") +): + """Build all packages.""" + setup_logging(verbose) + + try: + root_dir = Path(__file__).parent.parent + builder = Builder(root_dir) + + success = builder.build_all( + dry_run=dry_run, + force=force, + parallel=parallel, + distro=distro + ) + + if not success: + raise typer.Exit(1) + + except KeyboardInterrupt: + typer.echo("Build interrupted by user") + raise typer.Exit(130) + +@app.command() +def verify( + verbose: bool = typer.Option(False, "--verbose", "-v", help="Enable verbose logging"), + fix_mode: bool = typer.Option(False, "--fix", help="Attempt to fix common issues automatically") +): + """Verify all metadata.yaml files against the schema.""" + setup_logging(verbose) + + root_dir = Path(__file__).parent.parent + rpms_dir = root_dir / "rpms" + + if not rpms_dir.exists(): + typer.echo(f"Error: RPMs directory not found: {rpms_dir}", err=True) + raise typer.Exit(1) + + validator = Validator(METADATA_SCHEMA) + total_files = 0 + valid_files = 0 + errors_found = [] + + typer.echo("🔍 Validating metadata.yaml files...") + typer.echo() + + # Find all metadata.yaml files + for package_dir in rpms_dir.iterdir(): + if not package_dir.is_dir() or package_dir.name.startswith('.'): + continue + + metadata_file = package_dir / "metadata.yaml" + if not metadata_file.exists(): + errors_found.append(f"❌ {package_dir.name}: metadata.yaml not found") + total_files += 1 + continue + + total_files += 1 + + try: + with open(metadata_file, 'r') as f: + metadata = yaml.safe_load(f) + + if metadata is None: + errors_found.append(f"❌ {package_dir.name}: Empty or invalid YAML") + continue + + # Validate against schema + if validator.validate(metadata): + if verbose: + typer.echo(f"✅ {package_dir.name}: Valid") + valid_files += 1 + else: + errors_found.append(f"❌ {package_dir.name}: Schema validation failed") + if verbose: + for field, error in validator.errors.items(): + typer.echo(f" └─ {field}: {error}", err=True) + else: + # Show summary of errors + error_summary = [] + for field, error in validator.errors.items(): + if isinstance(error, list): + error_summary.append(f"{field}: {error[0] if error else 'validation error'}") + else: + error_summary.append(f"{field}: {error}") + errors_found[-1] += f"\n Issues: {'; '.join(error_summary)}" + + except yaml.YAMLError as e: + errors_found.append(f"❌ {package_dir.name}: YAML parsing error - {e}") + except Exception as e: + errors_found.append(f"❌ {package_dir.name}: Unexpected error - {e}") + + # Print results + typer.echo() + typer.echo("📊 Validation Results:") + typer.echo(f" Total files: {total_files}") + typer.echo(f" Valid files: {valid_files}") + typer.echo(f" Invalid files: {total_files - valid_files}") + + if errors_found: + typer.echo() + typer.echo("🚨 Validation Errors:") + for error in errors_found: + typer.echo(error) + + if not verbose: + typer.echo() + typer.echo("💡 Run with --verbose for detailed error information") + + raise typer.Exit(1) + else: + typer.echo() + typer.echo("🎉 All metadata.yaml files are valid!") if __name__ == '__main__': - main() + app()