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

135
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,135 @@
# GitLab CI/CD configuration for mod_reqin_log
# Uses Docker-in-Docker (dind) for building and testing
stages:
- build
- test
- package
- verify
# Variables
variables:
DOCKER_TLS_CERTDIR: "/certs"
DOCKER_DRIVER: overlay2
VERSION: "1.0.0"
# =============================================================================
# Build Stage - Compile all packages
# =============================================================================
build-packages:
stage: build
image: docker:24
services:
- docker:24-dind
script:
# Build all packages (DEB + RPMs for el7, el8, el9)
- docker build -f Dockerfile.package
--target output
--build-arg VERSION=$VERSION
-t mod_reqin_log:packages .
# Create output directories
- mkdir -p dist/deb dist/rpm
# Extract packages from Docker image
- docker run --rm -v $(pwd)/dist:/output mod_reqin_log:packages
sh -c 'cp -r /packages/deb/* /output/deb/ && cp -r /packages/rpm/* /output/rpm/'
# List built packages
- echo "=== DEB Packages ==="
- ls -la dist/deb/
- echo "=== RPM Packages ==="
- ls -la dist/rpm/
artifacts:
paths:
- dist/deb/
- dist/rpm/
expire_in: 30 days
# =============================================================================
# Test Stage - Unit tests
# =============================================================================
unit-tests:
stage: test
image: docker:24
services:
- docker:24-dind
script:
# Build test image
- docker build -f Dockerfile.tests -t mod_reqin_log:tests .
# Run unit tests
- docker run --rm mod_reqin_log:tests ctest --output-on-failure
# =============================================================================
# Package Stage - Already done in build-packages
# =============================================================================
# =============================================================================
# Verify Stage - Test package installation on each target distribution
# =============================================================================
verify-rpm-el7:
stage: verify
image: docker:24
services:
- docker:24-dind
needs: [build-packages]
script:
# Download artifacts
- apk add --no-cache curl
- curl -L -o /tmp/rpm-el7.rpm "$CI_PROJECT_URL/-/jobs/$CI_JOB_ID/artifacts/dist/rpm/mod_reqin_log-$VERSION-1.el7.x86_64.rpm"
2>/dev/null || echo "Artifact download via curl failed, trying alternative..."
# Alternative: extract from build artifact
- docker run --rm -v $(pwd)/dist:/packages centos:7 sh -c "
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 &&
yum install -y /packages/rpm/*.el7.*.rpm &&
httpd -M 2>&1 | grep reqin_log &&
echo 'RPM el7 verification OK'
"
allow_failure: true
verify-rpm-el8:
stage: verify
image: docker:24
services:
- docker:24-dind
needs: [build-packages]
script:
- docker run --rm -v $(pwd)/dist:/packages rockylinux:8 sh -c "
dnf install -y /packages/rpm/*.el8.*.rpm &&
httpd -M 2>&1 | grep reqin_log &&
echo 'RPM el8 verification OK'
"
verify-rpm-el9:
stage: verify
image: docker:24
services:
- docker:24-dind
needs: [build-packages]
script:
- docker run --rm -v $(pwd)/dist:/packages rockylinux:9 sh -c "
dnf install -y /packages/rpm/*.el9.*.rpm &&
httpd -M 2>&1 | grep reqin_log &&
echo 'RPM el9 verification OK'
"
verify-deb:
stage: verify
image: docker:24
services:
- docker:24-dind
needs: [build-packages]
script:
- docker run --rm -v $(pwd)/dist:/packages debian:stable sh -c "
apt-get update &&
apt-get install -y /packages/deb/*.deb &&
ls -la /usr/lib/apache2/modules/mod_reqin_log.so &&
echo 'DEB verification OK'
"