diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index ffa7d59..d09960b 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -10,15 +10,17 @@ jobs: runs-on: almalinux-8 container: image: git.unkin.net/unkin/almalinux8-actionsdind:latest - options: --privileged + options: "--privileged --volume /etc/pki/tls/vault:/etc/pki/tls/vault:ro" steps: - name: Checkout code uses: actions/checkout@v3 - name: Build Packages + env: + VAULT_ROLE_ID: ${{ secrets.RPMBUILDER_VAULT_ROLEID }} run: | - make all + ./tools/build build-all --distro almalinux/el8 - name: Show RPMs run: | @@ -34,15 +36,17 @@ jobs: runs-on: almalinux-8 container: image: git.unkin.net/unkin/almalinux9-actionsdind:latest - options: --privileged + options: "--privileged --volume /etc/pki/tls/vault:/etc/pki/tls/vault:ro" steps: - name: Checkout code uses: actions/checkout@v3 - name: Build Packages + env: + VAULT_ROLE_ID: ${{ secrets.RPMBUILDER_VAULT_ROLEID }} run: | - make all + ./tools/build build-all --distro almalinux/el9 - name: Show RPMs run: | diff --git a/.gitignore b/.gitignore index 1521c8b..be49a96 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ dist +env +.claude diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..47d0867 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +ARG BASE_IMAGE=git.unkin.net/unkin/almalinux9-rpmbuilder:latest +FROM ${BASE_IMAGE} + +# Create output directory for RPMs +RUN mkdir -p /app/dist + +# Set working directory +WORKDIR /app + +# 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 + +# Default command to build RPMs +CMD /app/resources/build.sh \ No newline at end of file diff --git a/Makefile b/Makefile index 7e634a1..8c56409 100644 --- a/Makefile +++ b/Makefile @@ -1,58 +1,49 @@ # Variables ROOT_DIR := $(PWD) -RPMS_DIR := $(ROOT_DIR)/rpms -REPO_OPTIONS := --disablerepo=* --enablerepo=unkin +BUILD_TOOL := $(ROOT_DIR)/tools/build +DISTRO ?= almalinux/el9 -# Automatically find all package/version directories -PACKAGES := $(shell find $(RPMS_DIR) -mindepth 2 -maxdepth 2 -type d | sed "s|$(RPMS_DIR)/||" | grep -Ev '(scripts|/resources)') +# 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) -# Default target to build all packages and versions -.PHONY: all list cache build clean -all: cache $(PACKAGES) +# Default target to build all packages +.PHONY: all list build clean +all: build-all +# List all available packages list: - @echo "Builds:" + @echo "Available packages:" @for package in $(PACKAGES); do \ - echo " '$$package'"; \ + echo " $$package"; \ done -cache: - echo "Refreshing DNF cache..." && \ - dnf clean all && \ - dnf makecache +# Build all packages using Python tool +build-all: + @echo "Building all packages using Python tooling for distro $(DISTRO)..." + $(BUILD_TOOL) build-all --distro $(DISTRO) -# Build specific package/version +# Build specific package using Python tool .PHONY: $(PACKAGES) $(PACKAGES): - @PACKAGE_NAME=$(shell echo $(@) | cut -d/ -f1) && \ - PACKAGE_VERSION=$(shell echo $(@) | cut -d/ -f2) && \ - echo "Starting build $$PACKAGE_NAME/$$PACKAGE_VERSION" && \ - $(MAKE) build PACKAGE_NAME=$$PACKAGE_NAME PACKAGE_VERSION=$$PACKAGE_VERSION + @echo "Building package: $@ for distro $(DISTRO)" + $(BUILD_TOOL) build --distro $(DISTRO) $@ -# Build target -build: - @mkdir -p $(ROOT_DIR)/dist/$(PACKAGE_NAME)/ - @cd $(RPMS_DIR)/$(PACKAGE_NAME) && \ - export PACKAGE_RELEASE=$$(cat $(PACKAGE_VERSION)/release) && \ - export PACKAGE_FULL_NAME=$(PACKAGE_NAME)-$(PACKAGE_VERSION)-$$PACKAGE_RELEASE && \ - echo "Checking repos for $$PACKAGE_FULL_NAME" && \ - if dnf info $$PACKAGE_FULL_NAME $(REPO_OPTIONS) > /dev/null 2>&1; then \ - echo "Skipping build for $(PACKAGE_NAME) version $(PACKAGE_VERSION) (already exists in the repository)"; \ - else \ - echo "Building RPM for $(PACKAGE_NAME) version $(PACKAGE_VERSION)"; \ - docker build \ - --build-arg PACKAGE_VERSION=$(PACKAGE_VERSION) \ - --build-arg PACKAGE_RELEASE=$${PACKAGE_RELEASE} \ - -t $$(echo $(PACKAGE_NAME)-builder \ - | tr '[:upper:]' '[:lower:]') . && \ - docker create --name $(PACKAGE_NAME)-$(PACKAGE_VERSION)-builder \ - $$(echo $(PACKAGE_NAME)-builder | tr '[:upper:]' '[:lower:]') && \ - docker start -a $(PACKAGE_NAME)-$(PACKAGE_VERSION)-builder && \ - docker cp $(PACKAGE_NAME)-$(PACKAGE_VERSION)-builder:/app/dist/. $(ROOT_DIR)/dist/$(PACKAGE_NAME)/ && \ - docker rm $(PACKAGE_NAME)-$(PACKAGE_VERSION)-builder; \ - fi +# Dry run - show what would be built without building +dry-run: + @echo "Dry run - showing what would be built for distro $(DISTRO):" + $(BUILD_TOOL) build-all --distro $(DISTRO) --dry-run # Clean target clean: @echo "Cleaning build artifacts..." rm -rf $(ROOT_DIR)/dist + +# Update packages from GitHub releases +update: + @echo "Checking for package updates from GitHub releases..." + $(ROOT_DIR)/tools/update-gh --all + +# Update specific package from GitHub +update-%: + @echo "Checking for updates for package: $*" + $(ROOT_DIR)/tools/update-gh --package $* diff --git a/rpms/act_runner/0.2.12/release b/rpms/act_runner/0.2.12/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/act_runner/0.2.12/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/act_runner/Dockerfile b/rpms/act_runner/Dockerfile deleted file mode 100644 index f8cf216..0000000 --- a/rpms/act_runner/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy nfpm.yaml from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/0.8.0/release b/rpms/bind_exporter/0.8.0/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/bind_exporter/0.8.0/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/bind_exporter/Dockerfile b/rpms/bind_exporter/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/bind_exporter/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/0.6.1/release b/rpms/boilerplate/0.6.1/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/boilerplate/0.6.1/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/boilerplate/Dockerfile b/rpms/boilerplate/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/boilerplate/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/1.7.1/release b/rpms/cni-plugins/1.7.1/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/cni-plugins/1.7.1/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/cni-plugins/Dockerfile b/rpms/cni-plugins/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/cni-plugins/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/1.7.1/release b/rpms/consul-cni/1.7.1/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/consul-cni/1.7.1/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/consul-cni/Dockerfile b/rpms/consul-cni/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/consul-cni/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/1.21.1/release b/rpms/consul/1.21.1/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/consul/1.21.1/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/consul/Dockerfile b/rpms/consul/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/consul/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/3.5.18/release b/rpms/etcd/3.5.18/release deleted file mode 100644 index 0cfbf08..0000000 --- a/rpms/etcd/3.5.18/release +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/rpms/etcd/Dockerfile b/rpms/etcd/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/etcd/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/2.2.0/release b/rpms/exportarr/2.2.0/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/exportarr/2.2.0/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/exportarr/Dockerfile b/rpms/exportarr/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/exportarr/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/1.8.0/release b/rpms/frr_exporter/1.8.0/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/frr_exporter/1.8.0/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/frr_exporter/Dockerfile b/rpms/frr_exporter/Dockerfile deleted file mode 100644 index f8cf216..0000000 --- a/rpms/frr_exporter/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy nfpm.yaml from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/0.9.10/release b/rpms/g10k/0.9.10/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/g10k/0.9.10/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/g10k/Dockerfile b/rpms/g10k/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/g10k/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/1.1.7/release b/rpms/helmfile/1.1.7/release deleted file mode 100644 index 56a6051..0000000 --- a/rpms/helmfile/1.1.7/release +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/rpms/helmfile/Dockerfile b/rpms/helmfile/Dockerfile deleted file mode 100644 index 539afe6..0000000 --- a/rpms/helmfile/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh \ No newline at end of file diff --git a/rpms/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/6.10.1/release b/rpms/incus/6.10.1/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/incus/6.10.1/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/incus/Dockerfile b/rpms/incus/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/incus/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/7.1.1/release b/rpms/jellyfin-ffmpeg-bin/7.1.1/release deleted file mode 100644 index 00750ed..0000000 --- a/rpms/jellyfin-ffmpeg-bin/7.1.1/release +++ /dev/null @@ -1 +0,0 @@ -3 diff --git a/rpms/jellyfin-ffmpeg-bin/Dockerfile b/rpms/jellyfin-ffmpeg-bin/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/jellyfin-ffmpeg-bin/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/10.10.7/release b/rpms/jellyfin-server/10.10.7/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/jellyfin-server/10.10.7/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/jellyfin-server/Dockerfile b/rpms/jellyfin-server/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/jellyfin-server/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/10.10.7/release b/rpms/jellyfin-web/10.10.7/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/jellyfin-web/10.10.7/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/jellyfin-web/Dockerfile b/rpms/jellyfin-web/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/jellyfin-web/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/0.16.0/release b/rpms/jsonnet-language-server/0.16.0/release deleted file mode 100644 index 56a6051..0000000 --- a/rpms/jsonnet-language-server/0.16.0/release +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/rpms/jsonnet-language-server/Dockerfile b/rpms/jsonnet-language-server/Dockerfile deleted file mode 100644 index 539afe6..0000000 --- a/rpms/jsonnet-language-server/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh \ No newline at end of file diff --git a/rpms/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/0.21.0/release b/rpms/jsonnet-lint/0.21.0/release deleted file mode 100644 index 56a6051..0000000 --- a/rpms/jsonnet-lint/0.21.0/release +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/rpms/jsonnet-lint/Dockerfile b/rpms/jsonnet-lint/Dockerfile deleted file mode 100644 index f7d01bb..0000000 --- a/rpms/jsonnet-lint/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# Start with the AlmaLinux 9 base image -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh \ No newline at end of file diff --git a/rpms/jsonnet-lint/metadata.yaml b/rpms/jsonnet-lint/metadata.yaml new file mode 100644 index 0000000..1c4bbd4 --- /dev/null +++ b/rpms/jsonnet-lint/metadata.yaml @@ -0,0 +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 +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/0.21.0/release b/rpms/jsonnet/0.21.0/release deleted file mode 100644 index 56a6051..0000000 --- a/rpms/jsonnet/0.21.0/release +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/rpms/jsonnet/Dockerfile b/rpms/jsonnet/Dockerfile deleted file mode 100644 index f7d01bb..0000000 --- a/rpms/jsonnet/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# Start with the AlmaLinux 9 base image -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh \ No newline at end of file diff --git a/rpms/jsonnet/metadata.yaml b/rpms/jsonnet/metadata.yaml new file mode 100644 index 0000000..cd1b6d2 --- /dev/null +++ b/rpms/jsonnet/metadata.yaml @@ -0,0 +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 +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/7.3.71/release b/rpms/libfoundationdb/7.3.71/release deleted file mode 100644 index 56a6051..0000000 --- a/rpms/libfoundationdb/7.3.71/release +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/rpms/libfoundationdb/Dockerfile b/rpms/libfoundationdb/Dockerfile deleted file mode 100644 index 539afe6..0000000 --- a/rpms/libfoundationdb/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh \ No newline at end of file diff --git a/rpms/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/2.41.1/release b/rpms/nfpm/2.41.1/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/nfpm/2.41.1/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/nfpm/Dockerfile b/rpms/nfpm/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/nfpm/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/1.9.1/release b/rpms/node_exporter/1.9.1/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/node_exporter/1.9.1/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/node_exporter/Dockerfile b/rpms/node_exporter/Dockerfile deleted file mode 100644 index 6d5dcec..0000000 --- a/rpms/node_exporter/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - - -# Default command to build RPMs -CMD /app/resources/build.sh 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/0.4.6/release b/rpms/nomad-autoscaler/0.4.6/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/nomad-autoscaler/0.4.6/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/nomad-autoscaler/Dockerfile b/rpms/nomad-autoscaler/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/nomad-autoscaler/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/1.10.1/release b/rpms/nomad/1.10.1/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/nomad/1.10.1/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/nomad/Dockerfile b/rpms/nomad/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/nomad/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/25.0/release b/rpms/nzbget/25.0/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/nzbget/25.0/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/nzbget/Dockerfile b/rpms/nzbget/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/nzbget/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/2025.08.03/release b/rpms/nzbget_exporter/2025.08.03/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/nzbget_exporter/2025.08.03/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/nzbget_exporter/Dockerfile b/rpms/nzbget_exporter/Dockerfile deleted file mode 100644 index f8cf216..0000000 --- a/rpms/nzbget_exporter/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy nfpm.yaml from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/0.1.0/release b/rpms/openbao-plugin-secret-consul/0.1.0/release deleted file mode 100644 index 56a6051..0000000 --- a/rpms/openbao-plugin-secret-consul/0.1.0/release +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/rpms/openbao-plugin-secret-consul/Dockerfile b/rpms/openbao-plugin-secret-consul/Dockerfile deleted file mode 100644 index 539afe6..0000000 --- a/rpms/openbao-plugin-secret-consul/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh \ No newline at end of file diff --git a/rpms/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/0.1.4/release b/rpms/openbao-plugin-secret-nomad/0.1.4/release deleted file mode 100644 index 56a6051..0000000 --- a/rpms/openbao-plugin-secret-nomad/0.1.4/release +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/rpms/openbao-plugin-secret-nomad/Dockerfile b/rpms/openbao-plugin-secret-nomad/Dockerfile deleted file mode 100644 index 539afe6..0000000 --- a/rpms/openbao-plugin-secret-nomad/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh \ No newline at end of file diff --git a/rpms/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/1.0.0/release b/rpms/openbao-plugins/1.0.0/release deleted file mode 100644 index 56a6051..0000000 --- a/rpms/openbao-plugins/1.0.0/release +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/rpms/openbao-plugins/Dockerfile b/rpms/openbao-plugins/Dockerfile deleted file mode 100644 index 539afe6..0000000 --- a/rpms/openbao-plugins/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh \ No newline at end of file diff --git a/rpms/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/1.13.1/release b/rpms/packer/1.13.1/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/packer/1.13.1/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/packer/Dockerfile b/rpms/packer/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/packer/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/0.11.0/release b/rpms/pgbouncer_exporter/0.11.0/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/pgbouncer_exporter/0.11.0/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/pgbouncer_exporter/Dockerfile b/rpms/pgbouncer_exporter/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/pgbouncer_exporter/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/0.17.1/release b/rpms/postgres_exporter/0.17.1/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/postgres_exporter/0.17.1/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/postgres_exporter/Dockerfile b/rpms/postgres_exporter/Dockerfile deleted file mode 100644 index 6d5dcec..0000000 --- a/rpms/postgres_exporter/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - - -# Default command to build RPMs -CMD /app/resources/build.sh 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/1.0.3/release b/rpms/puppet-initial/1.0.3/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/puppet-initial/1.0.3/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/puppet-initial/Dockerfile b/rpms/puppet-initial/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/puppet-initial/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/1.1.0/release b/rpms/puppetdb_exporter/1.1.0/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/puppetdb_exporter/1.1.0/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/puppetdb_exporter/Dockerfile b/rpms/puppetdb_exporter/Dockerfile deleted file mode 100644 index f8cf216..0000000 --- a/rpms/puppetdb_exporter/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy nfpm.yaml from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/0.8.1/release b/rpms/ruff/0.8.1/release deleted file mode 100644 index 1e8b314..0000000 --- a/rpms/ruff/0.8.1/release +++ /dev/null @@ -1 +0,0 @@ -6 diff --git a/rpms/ruff/Dockerfile b/rpms/ruff/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/ruff/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/0.13.4/release b/rpms/stalwart-cli/0.13.4/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/stalwart-cli/0.13.4/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/stalwart-cli/Dockerfile b/rpms/stalwart-cli/Dockerfile deleted file mode 100644 index 539afe6..0000000 --- a/rpms/stalwart-cli/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh \ No newline at end of file diff --git a/rpms/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/0.13.4/release b/rpms/stalwart-foundationdb/0.13.4/release deleted file mode 100644 index 0cfbf08..0000000 --- a/rpms/stalwart-foundationdb/0.13.4/release +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/rpms/stalwart-foundationdb/Dockerfile b/rpms/stalwart-foundationdb/Dockerfile deleted file mode 100644 index 539afe6..0000000 --- a/rpms/stalwart-foundationdb/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh \ No newline at end of file diff --git a/rpms/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/0.13.4/release b/rpms/stalwart/0.13.4/release deleted file mode 100644 index 0cfbf08..0000000 --- a/rpms/stalwart/0.13.4/release +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/rpms/stalwart/Dockerfile b/rpms/stalwart/Dockerfile deleted file mode 100644 index 539afe6..0000000 --- a/rpms/stalwart/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh \ No newline at end of file diff --git a/rpms/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/1.12.1/release b/rpms/terraform/1.12.1/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/terraform/1.12.1/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/terraform/1.5.0/release b/rpms/terraform/1.5.0/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/terraform/1.5.0/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/terraform/Dockerfile b/rpms/terraform/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/terraform/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/0.81.0/release b/rpms/terragrunt/0.81.0/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/terragrunt/0.81.0/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/terragrunt/0.90.0/release b/rpms/terragrunt/0.90.0/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/terragrunt/0.90.0/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/terragrunt/Dockerfile b/rpms/terragrunt/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/terragrunt/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/0.59.1/release b/rpms/tflint/0.59.1/release deleted file mode 100644 index 56a6051..0000000 --- a/rpms/tflint/0.59.1/release +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/rpms/tflint/Dockerfile b/rpms/tflint/Dockerfile deleted file mode 100644 index 539afe6..0000000 --- a/rpms/tflint/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh \ No newline at end of file diff --git a/rpms/tflint/metadata.yaml b/rpms/tflint/metadata.yaml 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/2025.07.13/release b/rpms/unkin-ca-certificates/2025.07.13/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/unkin-ca-certificates/2025.07.13/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/unkin-ca-certificates/Dockerfile b/rpms/unkin-ca-certificates/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/unkin-ca-certificates/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/20250712.0.2/release b/rpms/unkin-undionly-kpxe/20250712.0.2/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/unkin-undionly-kpxe/20250712.0.2/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/unkin-undionly-kpxe/Dockerfile b/rpms/unkin-undionly-kpxe/Dockerfile deleted file mode 100644 index f8cf216..0000000 --- a/rpms/unkin-undionly-kpxe/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy nfpm.yaml from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/7.11.0/release b/rpms/unrar/7.11.0/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/unrar/7.11.0/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/unrar/Dockerfile b/rpms/unrar/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/unrar/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/0.5.11/release b/rpms/uv/0.5.11/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/uv/0.5.11/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/uv/0.5.5/release b/rpms/uv/0.5.5/release deleted file mode 100644 index 0cfbf08..0000000 --- a/rpms/uv/0.5.5/release +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/rpms/uv/0.6.5/release b/rpms/uv/0.6.5/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/uv/0.6.5/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/uv/Dockerfile b/rpms/uv/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/uv/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/0.42.2/release b/rpms/vals/0.42.2/release deleted file mode 100644 index 56a6051..0000000 --- a/rpms/vals/0.42.2/release +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/rpms/vals/Dockerfile b/rpms/vals/Dockerfile deleted file mode 100644 index 539afe6..0000000 --- a/rpms/vals/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh \ No newline at end of file diff --git a/rpms/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/1.19.5/release b/rpms/vault/1.19.5/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/vault/1.19.5/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/vault/Dockerfile b/rpms/vault/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/vault/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/1.26.0/release b/rpms/victoria-logs/1.26.0/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/victoria-logs/1.26.0/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/victoria-logs/Dockerfile b/rpms/victoria-logs/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/victoria-logs/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/1.26.0/release b/rpms/vlutils/1.26.0/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/vlutils/1.26.0/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/vlutils/Dockerfile b/rpms/vlutils/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/vlutils/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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/1.119.0/release b/rpms/vmagent/1.119.0/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/vmagent/1.119.0/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/vmagent/Dockerfile b/rpms/vmagent/Dockerfile deleted file mode 100644 index 6d5dcec..0000000 --- a/rpms/vmagent/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - - -# Default command to build RPMs -CMD /app/resources/build.sh 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/1.119.0/release b/rpms/vmalert/1.119.0/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/vmalert/1.119.0/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/vmalert/Dockerfile b/rpms/vmalert/Dockerfile deleted file mode 100644 index 6d5dcec..0000000 --- a/rpms/vmalert/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - - -# Default command to build RPMs -CMD /app/resources/build.sh 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/1.119.0/release b/rpms/vminsert/1.119.0/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/vminsert/1.119.0/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/vminsert/Dockerfile b/rpms/vminsert/Dockerfile deleted file mode 100644 index 6d5dcec..0000000 --- a/rpms/vminsert/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - - -# Default command to build RPMs -CMD /app/resources/build.sh 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/1.119.0/release b/rpms/vmselect/1.119.0/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/vmselect/1.119.0/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/vmselect/Dockerfile b/rpms/vmselect/Dockerfile deleted file mode 100644 index 6d5dcec..0000000 --- a/rpms/vmselect/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - - -# Default command to build RPMs -CMD /app/resources/build.sh 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/1.119.0/release b/rpms/vmstorage/1.119.0/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/vmstorage/1.119.0/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/vmstorage/Dockerfile b/rpms/vmstorage/Dockerfile deleted file mode 100644 index 6d5dcec..0000000 --- a/rpms/vmstorage/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - - -# Default command to build RPMs -CMD /app/resources/build.sh 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/1.119.0/release b/rpms/vmutils/1.119.0/release deleted file mode 100644 index d00491f..0000000 --- a/rpms/vmutils/1.119.0/release +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/rpms/vmutils/Dockerfile b/rpms/vmutils/Dockerfile deleted file mode 100644 index 8d00407..0000000 --- a/rpms/vmutils/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM git.unkin.net/unkin/almalinux9-rpmbuilder:latest - -# Create output directory for RPMs -RUN mkdir -p /app/dist - -# Set working directory -WORKDIR /app - -ARG PACKAGE_RELEASE -ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} -ARG PACKAGE_VERSION -ENV PACKAGE_VERSION=${PACKAGE_VERSION} - -# Copy resources from the context into the container -COPY resources /app/resources - -# Default command to build RPMs -CMD /app/resources/build.sh 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 new file mode 100755 index 0000000..09db6b6 --- /dev/null +++ b/tools/build @@ -0,0 +1,1126 @@ +#!/usr/bin/env -S uv run --script +# /// script +# dependencies = [ +# "typer", +# "requests", +# "pyyaml", +# "hvac", +# "cerberus" +# ] +# /// + +# vim: filetype=python + +""" +RPM Builder Tool + +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 logging +import subprocess +import requests +from pathlib import Path +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: + """ + Initialize and authenticate Vault client using AppRole authentication. + + Returns: + Authenticated HVAC client + """ + logger = logging.getLogger(__name__) + + # Get required environment variables + vault_addr = os.getenv('VAULT_ADDR', 'https://vault.service.consul:8200') + vault_role_id = os.getenv('VAULT_ROLE_ID') + + if not vault_role_id: + logger.error("VAULT_ROLE_ID environment variable is required") + sys.exit(1) + + # Initialize Vault client with CA certificate + client = hvac.Client( + url=vault_addr, + verify='/etc/pki/tls/cert.pem' + ) + + # Authenticate using AppRole + try: + logger.debug(f"Authenticating to Vault at {vault_addr}") + client.auth.approle.login(role_id=vault_role_id) + + if not client.is_authenticated(): + logger.error("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}") + sys.exit(1) + + +def get_gitea_token() -> str: + """ + Retrieve Gitea API token from Vault. + + Returns: + Gitea API token + + Raises: + Exception if Vault authentication fails or token cannot be retrieved + """ + logger = logging.getLogger(__name__) + + client = get_vault_client() + + 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' + ) + gitea_token = gitea_secret['data']['data']['token'] + logger.debug("Successfully retrieved Gitea token from Vault") + except Exception as e: + logger.error(f"Failed to retrieve Gitea token from Vault: {e}") + sys.exit(1) + + if not gitea_token: + logger.error("Gitea token is empty") + sys.exit(1) + + return gitea_token + + +# ==================== GITEA API FUNCTIONS ==================== + +def normalize_version(version: str) -> str: + """ + Normalize version string by removing leading zeros from numeric components. + Gitea automatically does this normalization. + + Examples: + "2025.08.03" -> "2025.8.3" + "1.05.0" -> "1.5.0" + "0.6.1" -> "0.6.1" (no change needed) + + Args: + version: Original version string + + Returns: + Normalized version string + """ + import re + + # Split by common separators and normalize each numeric part + parts = re.split(r'([.\-_])', version) + normalized_parts = [] + + for part in parts: + # If this part is purely numeric and has leading zeros, remove them + if part.isdigit() and len(part) > 1 and part.startswith('0'): + # Remove leading zeros but keep at least one digit + normalized_parts.append(str(int(part))) + else: + normalized_parts.append(part) + + return ''.join(normalized_parts) + + +def check_package_exists(package_name: str, version: str, release: str) -> bool: + """ + Check if a package version exists in the Gitea package registry. + + Args: + package_name: Name of the package + version: Version string + release: Release number + + Returns: + True if package exists, False otherwise + """ + logger = logging.getLogger(__name__) + + # Get configuration from environment + base_url = os.getenv('GITEA_URL', 'https://git.unkin.net') + owner = os.getenv('GITEA_OWNER', 'unkin') + package_type = os.getenv('GITEA_PACKAGE_TYPE', 'rpm') + + # 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) + # e.g., "2025.08.03" becomes "2025.8.3" + normalized_version = normalize_version(version) + full_version = f"{normalized_version}-{release}" + url = ( + f"{base_url}/api/v1/packages/{owner}/" + f"{package_type}/{package_name}/{full_version}" + ) + + headers = {'Authorization': f'token {gitea_token}'} + + logger.debug(f"Checking package existence: {url}") + response = requests.get(url, headers=headers, timeout=30) + + if response.status_code == 200: + package_info = response.json() + # Package exists if we get package info back + exists = bool(package_info.get('id')) + logger.debug(f"Package {package_name}:{full_version} {'exists' if exists else 'not found'}") + return exists + elif response.status_code == 404: + logger.debug(f"Package {package_name}:{full_version} not found (404)") + return False + elif response.status_code == 401: + logger.error("Authentication failed. Check GITEA_API_TOKEN.") + return False + else: + logger.warning( + f"Unexpected response checking package {package_name}:{full_version}: " + f"{response.status_code} - {response.text}" + ) + return False + + except requests.RequestException as e: + logger.error(f"Failed to check package {package_name}:{version}-{release}: {e}") + return False + + +def get_package_full_name(package_name: str, version: str, release: str) -> str: + """ + Generate the full package name as used in the registry. + + Args: + package_name: Package name + version: Version string + release: Release number + + Returns: + Full package name string + """ + return f"{package_name}-{version}-{release}" + + +# ==================== DOCKER FUNCTIONS ==================== + +def check_docker_available() -> bool: + """ + Check if Docker is available and running. + + Returns: + True if Docker is available, False otherwise + """ + try: + result = subprocess.run( + ['docker', 'version'], + capture_output=True, + text=True, + timeout=10 + ) + return result.returncode == 0 + except (subprocess.TimeoutExpired, FileNotFoundError): + return False + + +def cleanup_container(container_name: str) -> None: + """ + Remove a Docker container. + + Args: + container_name: Name of the container to remove + """ + logger = logging.getLogger(__name__) + try: + remove_args = ['docker', 'rm', container_name] + logger.debug(f"Running: {' '.join(remove_args)}") + subprocess.run(remove_args, capture_output=True, text=True) + except Exception as e: + logger.warning(f"Failed to remove container {container_name}: {e}") + + +def get_base_image_from_metadata(package_dir: Path, distro: str = "el/9") -> str: + """ + Get the base image from package metadata.yaml. + + Args: + package_dir: Directory containing the package + distro: Target distro (default: el/9) + + Returns: + Base image URL or default if not found + """ + metadata_file = package_dir / "metadata.yaml" + default_image = "git.unkin.net/unkin/almalinux9-rpmbuilder:latest" + + if not metadata_file.exists(): + return default_image + + try: + with open(metadata_file, 'r') as f: + metadata = yaml.safe_load(f) + + build_configs = metadata.get('builds', []) + for config in build_configs: + if config.get('distro') == distro: + return config.get('image', default_image) + + # If no matching distro found, return first image or default + if build_configs: + return build_configs[0].get('image', default_image) + + return default_image + + except Exception: + return default_image + + +def build_package_docker( + package_dir: Path, + package_name: str, + package_version: str, + package_release: str, + dist_dir: Path, + base_image: str = "git.unkin.net/unkin/almalinux9-rpmbuilder:latest", + dry_run: bool = False +) -> bool: + """ + Build a package using Docker with central Dockerfile. + + Args: + package_dir: Directory containing the package resources + package_name: Name of the package + package_version: Package version + package_release: Package release number + dist_dir: Directory to store built packages + base_image: Base Docker image to use for building + dry_run: If True, only show what would be done + + Returns: + True if build succeeded, False otherwise + """ + logger = logging.getLogger(__name__) + + try: + # Ensure dist directory exists + package_dist_dir = dist_dir / package_name + if not dry_run: + package_dist_dir.mkdir(parents=True, exist_ok=True) + + # Generate Docker image name + 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 + + # 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) + ] + + logger.debug(f"Running: {' '.join(build_args)}") + result = subprocess.run( + build_args, + capture_output=True, + text=True, + cwd=package_dir + ) + + if result.returncode != 0: + logger.error(f"Docker build failed for {package_name}") + logger.error(f"stdout: {result.stdout}") + logger.error(f"stderr: {result.stderr}") + return False + + # Step 2: Create and start container + create_args = [ + 'docker', 'create', + '--name', container_name, + image_name + ] + + logger.debug(f"Running: {' '.join(create_args)}") + result = subprocess.run(create_args, capture_output=True, text=True) + + if result.returncode != 0: + logger.error(f"Container creation failed for {package_name}") + logger.error(f"stderr: {result.stderr}") + return False + + try: + # Step 3: Start container + start_args = ['docker', 'start', '-a', container_name] + logger.debug(f"Running: {' '.join(start_args)}") + result = subprocess.run(start_args, capture_output=True, text=True) + + if result.returncode != 0: + logger.error(f"Container execution failed for {package_name}") + logger.error(f"stdout: {result.stdout}") + logger.error(f"stderr: {result.stderr}") + return False + + # Step 4: Copy artifacts + copy_args = [ + 'docker', 'cp', + f"{container_name}:/app/dist/.", + str(package_dist_dir) + "/" + ] + + logger.debug(f"Running: {' '.join(copy_args)}") + result = subprocess.run(copy_args, capture_output=True, text=True) + + if result.returncode != 0: + logger.error(f"Failed to copy artifacts for {package_name}") + logger.error(f"stderr: {result.stderr}") + return False + + logger.info(f"Successfully built {package_name}-{package_version}-{package_release}") + return True + + finally: + # Step 5: Clean up container + cleanup_container(container_name) + + except Exception as e: + logger.error(f"Unexpected error building {package_name}: {e}") + return False + + +def cleanup_images(image_pattern: str = "*-builder") -> None: + """ + Clean up Docker images matching a pattern. + + Args: + image_pattern: Pattern to match image names + """ + logger = logging.getLogger(__name__) + try: + # List images matching pattern + list_args = ['docker', 'images', '--format', '{{.Repository}}', '--filter', f'reference={image_pattern}'] + result = subprocess.run(list_args, capture_output=True, text=True) + + if result.returncode == 0 and result.stdout.strip(): + images = result.stdout.strip().split('\n') + if images: + remove_args = ['docker', 'rmi'] + images + subprocess.run(remove_args, capture_output=True, text=True) + logger.info(f"Cleaned up {len(images)} Docker images") + except Exception as e: + logger.warning(f"Failed to clean up Docker images: {e}") + + +# ==================== PACKAGE INFO CLASS ==================== + +@dataclass +class PackageInfo: + """Information about a package to build.""" + 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})" + + +# ==================== BUILDER CLASS ==================== + +class Builder: + """Main builder class that orchestrates package building.""" + + def __init__(self, root_dir: Path): + """ + Initialize the builder. + + Args: + root_dir: Root directory of the project + """ + self.root_dir = root_dir + self.rpms_dir = root_dir / "rpms" + self.dist_dir = root_dir / "dist" + + self.logger = logging.getLogger(__name__) + + # Ensure dist directory exists + self.dist_dir.mkdir(exist_ok=True) + + 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., 'almalinux/el8', 'almalinux/el9', 'all') + + Returns: + List of PackageInfo objects + """ + packages = [] + + if not self.rpms_dir.exists(): + self.logger.error(f"RPMs directory not found: {self.rpms_dir}") + return packages + + for package_dir in self.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(): + self.logger.warning(f"No metadata.yaml found for {package_dir.name}") + continue + + try: + with open(metadata_file, 'r') as f: + metadata = yaml.safe_load(f) + + package_name = metadata.get('name', package_dir.name) + build_configs = metadata.get('builds', []) + + if not build_configs: + self.logger.warning(f"No builds in metadata.yaml for {package_name}") + continue + + # Handle distro filtering + if distro == 'all': + # Build for all configured distros + for build_config in build_configs: + if isinstance(build_config, dict): + repositories = build_config.get('repository', []) + base_image = build_config.get('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): + repositories = build_config.get('repository', []) + base_image = build_config.get('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: + # If no matching distro found, log a warning + self.logger.debug(f"No build config for {distro} found for {package_name}") + + except Exception as e: + self.logger.error(f"Error reading metadata.yaml for {package_dir.name}: {e}") + continue + + return packages + + def build_single( + self, + package: str, + version: str, + release: str, + dry_run: bool = False, + force: bool = False, + distro: str = 'almalinux/el9' + ) -> bool: + """ + Build a single package. + + Args: + package: Package name + version: Package version + 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., 'almalinux/el8', 'almalinux/el9', 'all') + + Returns: + True if build succeeded, False otherwise + """ + package_dir = self.rpms_dir / package + + if not package_dir.exists(): + self.logger.error(f"Package directory not found: {package_dir}") + return False + + # Read metadata.yaml to validate version/release + metadata_file = package_dir / "metadata.yaml" + if not metadata_file.exists(): + self.logger.error(f"metadata.yaml not found: {metadata_file}") + return False + + try: + with open(metadata_file, 'r') as f: + metadata = yaml.safe_load(f) + + # 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 almalinux/el9 + distro = 'almalinux/el9' + + for build_config in build_configs: + 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 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 + + package_info = PackageInfo(package, version, release, package_dir, distro, base_image) + return self._build_package(package_info, dry_run, force) + + def build_all(self, dry_run: bool = False, force: bool = False, parallel: int = 4, distro: str = 'el/9') -> bool: + """ + Build all packages. + + Args: + 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., 'almalinux/el8', 'almalinux/el9', 'all') + + Returns: + True if all builds succeeded, False otherwise + """ + packages = self.discover_packages(distro) + + if not packages: + self.logger.warning("No packages found to build") + return True + + self.logger.info(f"Found {len(packages)} packages to process") + + if parallel == 1: + return self._build_sequential(packages, dry_run, force) + else: + return self._build_parallel(packages, dry_run, force, parallel) + + def _build_sequential(self, packages: List[PackageInfo], dry_run: bool, force: bool) -> bool: + """Build packages sequentially.""" + success_count = 0 + + for package_info in packages: + if self._build_package(package_info, dry_run, force): + success_count += 1 + + self.logger.info(f"Built {success_count}/{len(packages)} packages successfully") + return success_count == len(packages) + + def _build_parallel(self, packages: List[PackageInfo], dry_run: bool, force: bool, parallel: int) -> bool: + """Build packages in parallel.""" + success_count = 0 + + with ThreadPoolExecutor(max_workers=parallel) as executor: + # Submit all build tasks + future_to_package = { + executor.submit(self._build_package, pkg, dry_run, force): pkg + for pkg in packages + } + + # Process completed builds + for future in as_completed(future_to_package): + package_info = future_to_package[future] + try: + success = future.result() + if success: + success_count += 1 + except Exception as e: + self.logger.error(f"Build failed for {package_info}: {e}") + + self.logger.info(f"Built {success_count}/{len(packages)} packages successfully") + return success_count == len(packages) + + def _build_package(self, package_info: PackageInfo, dry_run: bool, force: bool) -> bool: + """ + Build a single package. + + Args: + package_info: Package information + dry_run: If True, only show what would be done + force: If True, build even if package exists + + Returns: + True if build succeeded, False otherwise + """ + try: + # Check if package already exists (unless forced) + if not force: + if check_package_exists( + package_info.name, + package_info.version, + package_info.release + ): + self.logger.info( + f"Skipping {package_info} (already exists in repository)" + ) + return True + + # Check Docker is available (unless dry run) + if not dry_run and not check_docker_available(): + self.logger.error("Docker is not available or running") + return False + + # Build the package + return build_package_docker( + package_dir=package_info.directory, + package_name=package_info.name, + package_version=package_info.version, + package_release=package_info.release, + dist_dir=self.dist_dir, + base_image=package_info.base_image, + dry_run=dry_run + ) + + except Exception as e: + self.logger.error(f"Failed to build {package_info}: {e}") + return False + + + def clean_dist(self) -> None: + """Clean the dist directory.""" + if self.dist_dir.exists(): + import shutil + shutil.rmtree(self.dist_dir) + self.dist_dir.mkdir() + self.logger.info("Cleaned dist directory") + + +# ==================== TYPER APPLICATION ==================== + +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( + level=level, + format='%(asctime)s - %(levelname)s - %(message)s', + 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) + + packages = builder.discover_packages(distro) + if not packages: + typer.echo("No packages found") + return + + typer.echo("Available packages:") + for package_info in sorted(packages, key=lambda p: (p.name, p.version)): + typer.echo(f" {package_info}") + +@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: + root_dir = Path(__file__).parent.parent + builder = Builder(root_dir) + + # 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 metadata_file.exists(): + typer.echo(f"Error: metadata.yaml not found for package {package_name}", err=True) + raise typer.Exit(1) + + try: + 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 = found_build.get('version') + if not version: + typer.echo(f"Error: No version in build config for {distro} in {package_name}", err=True) + raise typer.Exit(1) + + if not release: + release = found_build.get('release') + if not release: + typer.echo(f"Error: No release in build config for {distro} in {package_name}", err=True) + raise typer.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=package_name, + version=version, + release=str(release), + dry_run=dry_run, + force=force, + distro=distro + ) + + if not success: + raise typer.Exit(1) + + except KeyboardInterrupt: + 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__': + app() diff --git a/tools/update-gh b/tools/update-gh new file mode 100755 index 0000000..cb6deef --- /dev/null +++ b/tools/update-gh @@ -0,0 +1,462 @@ +#!/usr/bin/env -S uv run --script +# /// script +# dependencies = [ +# "requests", +# "pyyaml", +# "hvac" +# ] +# /// + +# vim: filetype=python + +""" +GitHub Release Update Tool + +Checks GitHub releases for packages and updates metadata.yaml and release files +when newer versions are available. +""" + +import os +import sys +import argparse +import logging +import requests +import yaml +from pathlib import Path +from typing import Dict, Optional, List, Tuple +import re +import hvac + + +# ==================== VAULT FUNCTIONS ==================== + +def get_vault_client() -> hvac.Client: + """ + Initialize and authenticate Vault client using AppRole authentication. + + Returns: + Authenticated HVAC client + """ + logger = logging.getLogger(__name__) + + # Get required environment variables + vault_addr = os.getenv('VAULT_ADDR', 'https://vault.service.consul:8200') + vault_role_id = os.getenv('VAULT_ROLE_ID') + + if not vault_role_id: + logger.error("VAULT_ROLE_ID environment variable is required") + raise ValueError("VAULT_ROLE_ID environment variable is required") + + # Initialize Vault client with CA certificate + client = hvac.Client( + url=vault_addr, + verify='/etc/pki/tls/cert.pem' + ) + + # Authenticate using AppRole + try: + logger.debug(f"Authenticating to Vault at {vault_addr}") + auth_response = 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") + + logger.debug("Successfully authenticated with Vault") + return client + + except Exception as e: + logger.error(f"Vault authentication failed: {e}") + raise + + +def get_api_tokens() -> Tuple[str, str]: + """ + Retrieve GitHub and Gitea API tokens from Vault. + + Returns: + Tuple of (github_token, gitea_token) + + Raises: + Exception if Vault authentication fails or tokens 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( + mount_point='kv', + path='service/gitea/unkinben/tokens/read-only-packages' + ) + gitea_token = gitea_secret['data']['data']['token'] + 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}") + + 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") + + return github_token, gitea_token + + +def setup_logging(verbose=False): + """Set up logging configuration.""" + level = logging.DEBUG if verbose else logging.INFO + logging.basicConfig( + level=level, + format='%(asctime)s - %(levelname)s - %(message)s', + datefmt='%H:%M:%S' + ) + + +def load_env_vars(env_file: Path) -> Dict[str, str]: + """ + Load environment variables from env file. + + Args: + env_file: Path to the env file + + Returns: + Dictionary of environment variables + """ + env_vars = {} + + if not env_file.exists(): + return env_vars + + with open(env_file, 'r') as f: + for line in f: + line = line.strip() + if line and not line.startswith('#') and '=' in line: + # Handle export statements + if line.startswith('export '): + line = line[7:] # Remove 'export ' + + key, value = line.split('=', 1) + env_vars[key.strip()] = value.strip() + + return env_vars + + +def get_github_latest_release(repo: str) -> Optional[Dict]: + """ + Get the latest release from GitHub API. + + Args: + repo: GitHub repository in format "owner/repo" + + Returns: + Latest release info or None if not found + """ + logger = logging.getLogger(__name__) + + try: + # Get GitHub token from Vault + github_token, _ = get_api_tokens() + + url = f"https://api.github.com/repos/{repo}/releases/latest" + headers = { + 'Authorization': f'token {github_token}', + 'Accept': 'application/vnd.github.v3+json' + } + + logger.debug(f"Checking GitHub releases: {url}") + response = requests.get(url, headers=headers, timeout=30) + + if response.status_code == 200: + release = response.json() + logger.debug(f"Latest release for {repo}: {release.get('tag_name', 'unknown')}") + return release + elif response.status_code == 404: + logger.warning(f"No releases found for {repo}") + return None + elif response.status_code == 401: + logger.error("GitHub authentication failed. Check GITHUB_API_TOKEN.") + return None + else: + logger.warning( + f"Unexpected response from GitHub API for {repo}: " + f"{response.status_code} - {response.text}" + ) + return None + + except requests.RequestException as e: + logger.error(f"Failed to check GitHub releases for {repo}: {e}") + return None + + +def normalize_version(version: str) -> str: + """ + Normalize version string by removing 'v' prefix if present. + + Args: + version: Version string (e.g., "v1.2.3" or "1.2.3") + + Returns: + Normalized version string (e.g., "1.2.3") + """ + if version.startswith('v'): + return version[1:] + return version + + +def compare_versions(current: str, latest: str) -> bool: + """ + Compare version strings to determine if latest is newer. + This is a simple string comparison that works for semantic versions. + + Args: + current: Current version string + latest: Latest version string + + Returns: + True if latest is newer than current + """ + def version_tuple(v): + # Split by dots and convert to integers where possible + parts = [] + for part in v.split('.'): + try: + parts.append(int(part)) + except ValueError: + # Handle non-numeric parts + parts.append(part) + return tuple(parts) + + try: + return version_tuple(latest) > version_tuple(current) + except: + # Fallback to string comparison + return latest != current + + +def update_package_metadata(package_dir: Path, new_version: str, dry_run: bool = False) -> bool: + """ + Update package metadata.yaml with new version. + + Args: + package_dir: Path to package directory + new_version: New version to update to + dry_run: If True, only show what would be done + + Returns: + True if update was successful + """ + logger = logging.getLogger(__name__) + metadata_file = package_dir / "metadata.yaml" + + try: + # Load current metadata + with open(metadata_file, 'r') as f: + metadata = yaml.safe_load(f) + + old_version = metadata.get('version', 'unknown') + logger.info(f"Updating {metadata.get('name', 'unknown')} from {old_version} to {new_version}") + + if dry_run: + logger.info(f"[DRY RUN] Would update metadata.yaml version to {new_version}") + return True + + # Update version in metadata and reset release to 1 + metadata['version'] = new_version + metadata['release'] = 1 + + # Write updated metadata + with open(metadata_file, 'w') as f: + yaml.dump(metadata, f, default_flow_style=False, sort_keys=False) + + logger.info(f"Successfully updated {metadata.get('name')} to version {new_version}") + return True + + except Exception as e: + logger.error(f"Failed to update package metadata: {e}") + return False + + +def check_package_updates(package_dir: Path, dry_run: bool = False) -> bool: + """ + Check for updates for a single package. + + Args: + package_dir: Path to package directory + dry_run: If True, only show what would be done + + Returns: + True if package was updated or no update needed + """ + logger = logging.getLogger(__name__) + metadata_file = package_dir / "metadata.yaml" + + if not metadata_file.exists(): + logger.warning(f"No metadata.yaml found in {package_dir}") + return False + + try: + # Load metadata + with open(metadata_file, 'r') as f: + metadata = yaml.safe_load(f) + + package_name = metadata.get('name', package_dir.name) + current_version = metadata.get('version') + github_repo = metadata.get('github') + + if not github_repo: + logger.debug(f"Package {package_name} has no GitHub repo configured") + return True + + if not current_version: + logger.warning(f"Package {package_name} has no version in metadata") + return False + + logger.info(f"Checking {package_name} (current: {current_version}) from {github_repo}") + + # Get latest release from GitHub + latest_release = get_github_latest_release(github_repo) + if not latest_release: + return False + + latest_version = normalize_version(latest_release.get('tag_name', '')) + if not latest_version: + logger.warning(f"Could not determine latest version for {package_name}") + return False + + # Compare versions + if compare_versions(current_version, latest_version): + logger.info(f"New version available: {current_version} -> {latest_version}") + return update_package_metadata(package_dir, latest_version, dry_run) + else: + logger.info(f"Package {package_name} is up to date ({current_version})") + return True + + except Exception as e: + logger.error(f"Failed to check package {package_dir.name}: {e}") + return False + + +def find_packages_with_github(rpms_dir: Path) -> List[Path]: + """ + Find all packages that have GitHub repo configured. + + Args: + rpms_dir: Path to rpms directory + + Returns: + List of package directories with GitHub repos + """ + github_packages = [] + + 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(): + continue + + try: + with open(metadata_file, 'r') as f: + metadata = yaml.safe_load(f) + + if metadata.get('github'): + github_packages.append(package_dir) + except Exception: + continue + + return github_packages + + +def main(): + """Main entry point.""" + parser = argparse.ArgumentParser( + description='Check GitHub releases and update package metadata', + formatter_class=argparse.RawDescriptionHelpFormatter, + epilog=""" +Examples: + %(prog)s --package boilerplate + %(prog)s --all + %(prog)s --all --dry-run + """ + ) + + # Package selection arguments + group = parser.add_mutually_exclusive_group(required=True) + group.add_argument('--package', help='Package name to check') + group.add_argument('--all', action='store_true', help='Check all packages with GitHub repos') + + # Optional arguments + parser.add_argument('--dry-run', action='store_true', help='Show what would be done without making changes') + parser.add_argument('--verbose', '-v', action='store_true', help='Enable verbose logging') + + args = parser.parse_args() + + setup_logging(args.verbose) + logger = logging.getLogger(__name__) + + try: + # Get root directory and load environment + root_dir = Path(__file__).parent.parent + rpms_dir = root_dir / "rpms" + env_file = root_dir / "env" + + if not rpms_dir.exists(): + logger.error(f"RPMs directory not found: {rpms_dir}") + sys.exit(1) + + success = True + + if args.package: + # Check single package + package_dir = rpms_dir / args.package + if not package_dir.exists(): + logger.error(f"Package directory not found: {package_dir}") + sys.exit(1) + + success = check_package_updates(package_dir, args.dry_run) + else: + # Check all packages with GitHub repos + github_packages = find_packages_with_github(rpms_dir) + + if not github_packages: + logger.info("No packages with GitHub repos found") + sys.exit(0) + + logger.info(f"Found {len(github_packages)} packages with GitHub repos") + + updated_count = 0 + for package_dir in github_packages: + if check_package_updates(package_dir, args.dry_run): + updated_count += 1 + + logger.info(f"Successfully processed {updated_count}/{len(github_packages)} packages") + success = updated_count == len(github_packages) + + sys.exit(0 if success else 1) + + except KeyboardInterrupt: + logger.info("Update check interrupted by user") + sys.exit(130) + except Exception as e: + logger.error(f"Update check failed: {e}") + if args.verbose: + logger.exception("Full traceback:") + sys.exit(1) + + +if __name__ == '__main__': + main() \ No newline at end of file