ci: migrate to GitLab CI with multi-distribution RPM builds

- Replace GitHub Actions with GitLab CI using Docker-in-Docker
- Build 3 RPMs (el7, el8, el9) + 1 DEB from Dockerfile.package
- Add verify jobs for each target distribution
- Remove obsolete files:
  - Dockerfile, Dockerfile.test-socket (replaced by Dockerfile.package)
  - scripts/socket_consumer.py, scripts/socket_listener.py
  - scripts/test_unix_socket.sh, scripts/run_integration_tests.sh
- Update README.md with new package targets
- Update architecture.yml for GitLab CI workflow

Breaks: Single RPM no longer supported (glibc incompatibility)
Replaced by: Distribution-specific RPMs (el7, el8, el9)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
Jacquin Antoine
2026-02-28 16:06:57 +01:00
parent 2fc3f92cf8
commit a935ed1641
14 changed files with 392 additions and 1312 deletions

View File

@ -1,16 +1,49 @@
# syntax=docker/dockerfile:1
# =============================================================================
# mod_reqin_log - Dockerfile de packaging unifié (DEB + RPM avec fpm)
# Builds RPMs for multiple RHEL-compatible versions:
# - AlmaLinux 7 / CentOS 7 (el7) - RHEL 7 compatible (using vault repos)
# - Rocky Linux 8 (el8) - RHEL 8 compatible
# - Rocky Linux 9 (el9) - RHEL 9 compatible
# =============================================================================
# =============================================================================
# Stage 1: Builder - Compilation du module Apache
# Stage 1a: Builder CentOS 7 (RHEL 7 compatible, EOL - using vault)
# =============================================================================
FROM rockylinux:8 AS builder
FROM centos:7 AS builder-el7
# CentOS 7 is EOL since June 2024, use vault.centos.org for repositories
RUN sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/*.repo && \
sed -i 's/#baseurl/baseurl/g' /etc/yum.repos.d/*.repo && \
sed -i 's/metalink/#metalink/g' /etc/yum.repos.d/*.repo
# Install build dependencies
RUN yum install -y \
gcc \
make \
httpd \
httpd-devel \
apr-devel \
apr-util-devel \
python3 \
curl \
redhat-rpm-config \
&& yum clean all
WORKDIR /build
COPY src/ src/
COPY Makefile Makefile
COPY conf/ conf/
RUN make APXS=/usr/bin/apxs
RUN ls -la modules/mod_reqin_log.so
# =============================================================================
# Stage 1b: Builder Rocky Linux 8
# =============================================================================
FROM rockylinux:8 AS builder-el8
RUN dnf install -y epel-release && \
dnf install -y \
dnf install -y --allowerasing \
gcc \
make \
httpd \
@ -22,18 +55,36 @@ RUN dnf install -y epel-release && \
redhat-rpm-config \
&& dnf clean all
# Set working directory
WORKDIR /build
# Copy source files
COPY src/ src/
COPY Makefile Makefile
COPY conf/ conf/
# Build the module
RUN make APXS=/usr/bin/apxs
RUN ls -la modules/mod_reqin_log.so
# Verify module was built
# =============================================================================
# Stage 1c: Builder Rocky Linux 9
# =============================================================================
FROM rockylinux:9 AS builder-el9
RUN dnf install -y epel-release && \
dnf install -y --allowerasing \
gcc \
make \
httpd \
httpd-devel \
apr-devel \
apr-util-devel \
python3 \
curl \
redhat-rpm-config \
&& dnf clean all
WORKDIR /build
COPY src/ src/
COPY Makefile Makefile
COPY conf/ conf/
RUN make APXS=/usr/bin/apxs
RUN ls -la modules/mod_reqin_log.so
# =============================================================================
@ -53,13 +104,33 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& gem install fpm -v 1.16.0
# Copy binary from builder
COPY --from=builder /build/modules/mod_reqin_log.so /tmp/pkgroot/usr/lib/apache2/modules/mod_reqin_log.so
COPY --from=builder /build/conf/mod_reqin_log.conf /tmp/pkgroot/etc/apache2/conf-available/mod_reqin_log.conf
# =============================================================================
# Copy binaries from each builder stage
# =============================================================================
# Set permissions
RUN chmod 755 /tmp/pkgroot/usr/lib/apache2/modules/mod_reqin_log.so && \
chmod 644 /tmp/pkgroot/etc/apache2/conf-available/mod_reqin_log.conf
# CentOS 7 (el7)
COPY --from=builder-el7 /build/modules/mod_reqin_log.so /tmp/pkgroot-el7/usr/lib64/httpd/modules/mod_reqin_log.so
COPY --from=builder-el7 /build/conf/mod_reqin_log.conf /tmp/pkgroot-el7/etc/httpd/conf.d/mod_reqin_log.conf
RUN chmod 755 /tmp/pkgroot-el7/usr/lib64/httpd/modules/mod_reqin_log.so && \
chmod 644 /tmp/pkgroot-el7/etc/httpd/conf.d/mod_reqin_log.conf
# Rocky Linux 8 (el8)
COPY --from=builder-el8 /build/modules/mod_reqin_log.so /tmp/pkgroot-el8/usr/lib64/httpd/modules/mod_reqin_log.so
COPY --from=builder-el8 /build/conf/mod_reqin_log.conf /tmp/pkgroot-el8/etc/httpd/conf.d/mod_reqin_log.conf
RUN chmod 755 /tmp/pkgroot-el8/usr/lib64/httpd/modules/mod_reqin_log.so && \
chmod 644 /tmp/pkgroot-el8/etc/httpd/conf.d/mod_reqin_log.conf
# Rocky Linux 9 (el9)
COPY --from=builder-el9 /build/modules/mod_reqin_log.so /tmp/pkgroot-el9/usr/lib64/httpd/modules/mod_reqin_log.so
COPY --from=builder-el9 /build/conf/mod_reqin_log.conf /tmp/pkgroot-el9/etc/httpd/conf.d/mod_reqin_log.conf
RUN chmod 755 /tmp/pkgroot-el9/usr/lib64/httpd/modules/mod_reqin_log.so && \
chmod 644 /tmp/pkgroot-el9/etc/httpd/conf.d/mod_reqin_log.conf
# DEB package (Debian paths)
COPY --from=builder-el9 /build/modules/mod_reqin_log.so /tmp/pkgroot-deb/usr/lib/apache2/modules/mod_reqin_log.so
COPY --from=builder-el9 /build/conf/mod_reqin_log.conf /tmp/pkgroot-deb/etc/apache2/conf-available/mod_reqin_log.conf
RUN chmod 755 /tmp/pkgroot-deb/usr/lib/apache2/modules/mod_reqin_log.so && \
chmod 644 /tmp/pkgroot-deb/etc/apache2/conf-available/mod_reqin_log.conf
# Build DEB package (for Debian/Ubuntu)
ARG VERSION=1.0.0
@ -68,7 +139,7 @@ RUN mkdir -p /packages/deb && \
fpm -s dir -t deb \
-n libapache2-mod-reqin-log \
-v "${VERSION}" \
-C /tmp/pkgroot \
-C /tmp/pkgroot-deb \
--architecture "${ARCH}" \
--description "Apache HTTPD module for logging HTTP requests as JSON to Unix socket" \
--url "https://github.com/example/mod_reqin_log" \
@ -80,22 +151,61 @@ RUN mkdir -p /packages/deb && \
usr/lib/apache2/modules/mod_reqin_log.so \
etc/apache2/conf-available/mod_reqin_log.conf
# Build RPM package (for Rocky Linux/RHEL/CentOS)
ARG DIST=el8
# =============================================================================
# Build RPM packages for each distribution
# =============================================================================
# CentOS 7 (el7)
ARG VERSION=1.0.0
RUN mkdir -p /packages/rpm && \
fpm -s dir -t rpm \
-n mod_reqin_log \
-v "${VERSION}" \
-C /tmp/pkgroot \
--rpm-dist el7 \
-C /tmp/pkgroot-el7 \
--architecture "x86_64" \
--description "Apache HTTPD module for logging HTTP requests as JSON to Unix socket" \
--url "https://github.com/example/mod_reqin_log" \
--license "Apache-2.0" \
--vendor "Developer <dev@example.com>" \
--depends "httpd" \
-p /packages/rpm/mod_reqin_log-${VERSION}-1.x86_64.rpm \
usr/lib/apache2/modules/mod_reqin_log.so \
etc/apache2/conf-available/mod_reqin_log.conf
-p /packages/rpm/mod_reqin_log-${VERSION}-1.el7.x86_64.rpm \
usr/lib64/httpd/modules/mod_reqin_log.so \
etc/httpd/conf.d/mod_reqin_log.conf
# Rocky Linux 8 (el8)
RUN \
fpm -s dir -t rpm \
-n mod_reqin_log \
-v "${VERSION}" \
--rpm-dist el8 \
-C /tmp/pkgroot-el8 \
--architecture "x86_64" \
--description "Apache HTTPD module for logging HTTP requests as JSON to Unix socket" \
--url "https://github.com/example/mod_reqin_log" \
--license "Apache-2.0" \
--vendor "Developer <dev@example.com>" \
--depends "httpd" \
-p /packages/rpm/mod_reqin_log-${VERSION}-1.el8.x86_64.rpm \
usr/lib64/httpd/modules/mod_reqin_log.so \
etc/httpd/conf.d/mod_reqin_log.conf
# Rocky Linux 9 (el9)
RUN \
fpm -s dir -t rpm \
-n mod_reqin_log \
-v "${VERSION}" \
--rpm-dist el9 \
-C /tmp/pkgroot-el9 \
--architecture "x86_64" \
--description "Apache HTTPD module for logging HTTP requests as JSON to Unix socket" \
--url "https://github.com/example/mod_reqin_log" \
--license "Apache-2.0" \
--vendor "Developer <dev@example.com>" \
--depends "httpd" \
-p /packages/rpm/mod_reqin_log-${VERSION}-1.el9.x86_64.rpm \
usr/lib64/httpd/modules/mod_reqin_log.so \
etc/httpd/conf.d/mod_reqin_log.conf
# =============================================================================
# Stage 3: Output - Image finale avec les packages