diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 3bdafa0..c5f19cb 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -9,7 +9,7 @@ jobs: build-8: runs-on: almalinux-8 container: - image: git.query.consul/unkin/almalinux8-runnerdnd:latest + image: git.query.consul/unkin/almalinux8-actionsdind:latest options: --privileged steps: @@ -33,7 +33,7 @@ jobs: build-9: runs-on: almalinux-8 container: - image: git.query.consul/unkin/almalinux9-runnerdnd:latest + image: git.query.consul/unkin/almalinux9-actionsdind:latest options: --privileged steps: diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 08a129c..5fbd520 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -10,7 +10,7 @@ jobs: deploy-8: runs-on: almalinux-8 container: - image: git.query.consul/unkin/almalinux8-runnerdnd:latest + image: git.query.consul/unkin/almalinux8-actionsdind:latest options: --privileged steps: @@ -39,7 +39,7 @@ jobs: deploy-9: runs-on: almalinux-8 container: - image: git.query.consul/unkin/almalinux9-runnerdnd:latest + image: git.query.consul/unkin/almalinux9-actionsdind:latest options: --privileged steps: diff --git a/Makefile b/Makefile index 5b0a05e..7e634a1 100644 --- a/Makefile +++ b/Makefile @@ -4,14 +4,17 @@ RPMS_DIR := $(ROOT_DIR)/rpms REPO_OPTIONS := --disablerepo=* --enablerepo=unkin # Automatically find all package/version directories -PACKAGES := $(shell find $(RPMS_DIR) -mindepth 2 -maxdepth 2 -type d | sed "s|$(RPMS_DIR)/||" | grep -v "/scripts") +PACKAGES := $(shell find $(RPMS_DIR) -mindepth 2 -maxdepth 2 -type d | sed "s|$(RPMS_DIR)/||" | grep -Ev '(scripts|/resources)') # Default target to build all packages and versions .PHONY: all list cache build clean all: cache $(PACKAGES) list: - @echo "$(PACKAGES)" + @echo "Builds:" + @for package in $(PACKAGES); do \ + echo " '$$package'"; \ + done cache: echo "Refreshing DNF cache..." && \ diff --git a/rpms/cni-plugins/Dockerfile b/rpms/cni-plugins/Dockerfile index fd8c6ea..149f08f 100644 --- a/rpms/cni-plugins/Dockerfile +++ b/rpms/cni-plugins/Dockerfile @@ -1,5 +1,5 @@ # Start with the AlmaLinux 8.10 base image -FROM git.query.consul/unkin/almalinux8-buildagent:latest +FROM git.query.consul/unkin/almalinux8-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist diff --git a/rpms/consul/Dockerfile b/rpms/consul/Dockerfile index ac2c372..8338fd9 100644 --- a/rpms/consul/Dockerfile +++ b/rpms/consul/Dockerfile @@ -1,5 +1,5 @@ # Start with the AlmaLinux 8.10 base image -FROM git.query.consul/unkin/almalinux8-buildagent:latest +FROM git.query.consul/unkin/almalinux8-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist diff --git a/rpms/etcd/3.5.18/release b/rpms/etcd/3.5.18/release new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/rpms/etcd/3.5.18/release @@ -0,0 +1 @@ +1 diff --git a/rpms/etcd/Dockerfile b/rpms/etcd/Dockerfile new file mode 100644 index 0000000..628f8a6 --- /dev/null +++ b/rpms/etcd/Dockerfile @@ -0,0 +1,25 @@ +# Start with the AlmaLinux 8.10 base image +FROM git.query.consul/unkin/almalinux8-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 nfpm.yaml /app/nfpm.yaml +COPY resources /app/resources + +# Download the required files +RUN 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/ + +# Default command to build RPMs +CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm diff --git a/rpms/etcd/nfpm.yaml b/rpms/etcd/nfpm.yaml new file mode 100644 index 0000000..f495f32 --- /dev/null +++ b/rpms/etcd/nfpm.yaml @@ -0,0 +1,60 @@ +# nfpm.yaml + +name: etcd +version: ${PACKAGE_VERSION} +release: ${PACKAGE_RELEASE} +arch: amd64 +platform: linux +section: default +priority: extra +description: "A distributed, reliable key-value store for the most critical data of a distributed system." + +maintainer: https://etcd.io/ +homepage: https://etcd.io/ +license: Apache-2.0 + +disable_globbing: false + +replaces: + - etcd + - etcdctl + - etcdutl + +provides: + - etcd + - etcdctl + - etcdutl + +# Files to include in the package +contents: + - src: /app/etcd + dst: /usr/bin/etcd + file_info: + mode: 0755 + owner: root + group: root + - src: /app/etcdctl + dst: /usr/bin/etcdctl + file_info: + mode: 0755 + owner: root + group: root + - src: /app/etcdutl + dst: /usr/bin/etcdutl + file_info: + mode: 0755 + owner: root + group: root + - src: /app/resources/etcd.service + dst: /usr/lib/systemd/system/etcd.service + file_info: + mode: 0644 + owner: root + group: root + +# Scripts to run during installation/removal (optional) +scripts: + preinstall: ./resources/scripts/preinstall.sh + postinstall: ./resources/scripts/postinstall.sh + preremove: ./resources/scripts/preremove.sh + postremove: ./resources/scripts/postremove.sh diff --git a/rpms/etcd/resources/etcd.service b/rpms/etcd/resources/etcd.service new file mode 100644 index 0000000..8fc0570 --- /dev/null +++ b/rpms/etcd/resources/etcd.service @@ -0,0 +1,18 @@ +[Unit] +Description=etcd key-value store +Documentation=https://github.com/etcd-io/etcd +After=network-online.target local-fs.target remote-fs.target time-sync.target +Wants=network-online.target local-fs.target remote-fs.target time-sync.target + +[Service] +User=etcd +Type=notify +Environment=ETCD_DATA_DIR=/var/lib/etcd +Environment=ETCD_NAME=%m +ExecStart=/usr/bin/etcd +Restart=always +RestartSec=10s +LimitNOFILE=40000 + +[Install] +WantedBy=multi-user.target diff --git a/rpms/etcd/resources/scripts/postinstall.sh b/rpms/etcd/resources/scripts/postinstall.sh new file mode 100755 index 0000000..50041ee --- /dev/null +++ b/rpms/etcd/resources/scripts/postinstall.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +systemctl daemon-reload diff --git a/rpms/etcd/resources/scripts/postremove.sh b/rpms/etcd/resources/scripts/postremove.sh new file mode 100755 index 0000000..eb463c9 --- /dev/null +++ b/rpms/etcd/resources/scripts/postremove.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +rm -f /usr/lib/systemd/system/etcd.service +systemctl daemon-reload diff --git a/rpms/etcd/resources/scripts/preinstall.sh b/rpms/etcd/resources/scripts/preinstall.sh new file mode 100755 index 0000000..9c8237c --- /dev/null +++ b/rpms/etcd/resources/scripts/preinstall.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +groupadd --system etcd +useradd --system --shell /sbin/nologin --no-create-home --home-dir /var/lib/etcd --gid etcd etcd +mkdir -p /var/lib/etcd +chown etcd:etcd /var/lib/etcd diff --git a/rpms/etcd/resources/scripts/preremove.sh b/rpms/etcd/resources/scripts/preremove.sh new file mode 100755 index 0000000..1021f6c --- /dev/null +++ b/rpms/etcd/resources/scripts/preremove.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +systemctl stop etcd.service diff --git a/rpms/nfpm/Dockerfile b/rpms/nfpm/Dockerfile index 24d1b18..8fafb7b 100644 --- a/rpms/nfpm/Dockerfile +++ b/rpms/nfpm/Dockerfile @@ -1,5 +1,5 @@ # Start with the AlmaLinux 8.10 base image -FROM git.query.consul/unkin/almalinux8-buildagent:latest +FROM git.query.consul/unkin/almalinux8-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist diff --git a/rpms/nomad/Dockerfile b/rpms/nomad/Dockerfile index 33296e3..7028421 100644 --- a/rpms/nomad/Dockerfile +++ b/rpms/nomad/Dockerfile @@ -1,5 +1,5 @@ # Start with the AlmaLinux 8.10 base image -FROM git.query.consul/unkin/almalinux8-buildagent:latest +FROM git.query.consul/unkin/almalinux8-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist diff --git a/rpms/packer/Dockerfile b/rpms/packer/Dockerfile index e26aa2e..8a81557 100644 --- a/rpms/packer/Dockerfile +++ b/rpms/packer/Dockerfile @@ -1,5 +1,5 @@ # Start with the AlmaLinux 8.10 base image -FROM git.query.consul/unkin/almalinux8-buildagent:latest +FROM git.query.consul/unkin/almalinux8-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist diff --git a/rpms/ruff/Dockerfile b/rpms/ruff/Dockerfile index 93e10a9..65a8045 100644 --- a/rpms/ruff/Dockerfile +++ b/rpms/ruff/Dockerfile @@ -1,5 +1,5 @@ # Start with the AlmaLinux 8.10 base image -FROM git.query.consul/unkin/almalinux8-buildagent:latest +FROM git.query.consul/unkin/almalinux8-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist diff --git a/rpms/terraform/Dockerfile b/rpms/terraform/Dockerfile index 3877b7d..94cff6d 100644 --- a/rpms/terraform/Dockerfile +++ b/rpms/terraform/Dockerfile @@ -1,5 +1,5 @@ # Start with the AlmaLinux 8.10 base image -FROM git.query.consul/unkin/almalinux8-buildagent:latest +FROM git.query.consul/unkin/almalinux8-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist diff --git a/rpms/terragrunt/Dockerfile b/rpms/terragrunt/Dockerfile index df049c7..ab0cf22 100644 --- a/rpms/terragrunt/Dockerfile +++ b/rpms/terragrunt/Dockerfile @@ -1,5 +1,5 @@ # Start with the AlmaLinux 8.10 base image -FROM git.query.consul/unkin/almalinux8-buildagent:latest +FROM git.query.consul/unkin/almalinux8-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist diff --git a/rpms/uv/Dockerfile b/rpms/uv/Dockerfile index 1583ae1..a02d01f 100644 --- a/rpms/uv/Dockerfile +++ b/rpms/uv/Dockerfile @@ -1,5 +1,5 @@ # Start with the AlmaLinux 8.10 base image -FROM git.query.consul/unkin/almalinux8-buildagent:latest +FROM git.query.consul/unkin/almalinux8-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist diff --git a/rpms/vault/Dockerfile b/rpms/vault/Dockerfile index eacfaef..b4992ff 100644 --- a/rpms/vault/Dockerfile +++ b/rpms/vault/Dockerfile @@ -1,5 +1,5 @@ # Start with the AlmaLinux 8.10 base image -FROM git.query.consul/unkin/almalinux8-buildagent:latest +FROM git.query.consul/unkin/almalinux8-rpmbuilder:latest # Create output directory for RPMs RUN mkdir -p /app/dist