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:
157
architecture.yml
157
architecture.yml
@ -360,136 +360,51 @@ testing:
|
||||
ci:
|
||||
strategy:
|
||||
description: >
|
||||
All builds, tests and packaging are executed inside Docker containers.
|
||||
The host only needs Docker and the CI runner (GitHub Actions).
|
||||
All builds, tests and packaging are executed inside Docker containers
|
||||
using GitLab CI with Docker-in-Docker (dind).
|
||||
tools:
|
||||
orchestrator: GitHub Actions
|
||||
orchestrator: GitLab CI
|
||||
container_engine: docker
|
||||
workflow_file: .github/workflows/ci.yml
|
||||
dind: true
|
||||
workflow_file: .gitlab-ci.yml
|
||||
rpm_strategy: >
|
||||
Separate RPMs are built for each major RHEL/CentOS/Rocky version
|
||||
(el7, el8, el9) due to glibc and httpd-devel incompatibilities
|
||||
across major versions. A single RPM cannot work across all versions.
|
||||
Note: CentOS 7 is EOL since June 2024, repositories use vault.centos.org.
|
||||
All packages (DEB + multi-RPM) are built from Dockerfile.package.
|
||||
stages:
|
||||
- name: build
|
||||
description: >
|
||||
Compile mod_reqin_log as an Apache 2.4 module inside Docker images
|
||||
dedicated to each target distribution.
|
||||
jobs:
|
||||
- name: build-rocky-8
|
||||
image: "rockylinux:8"
|
||||
steps:
|
||||
- checkout: actions/checkout@v4
|
||||
- install_deps:
|
||||
- gcc
|
||||
- make
|
||||
- httpd
|
||||
- httpd-devel
|
||||
- apr-devel
|
||||
- apr-util-devel
|
||||
- rpm-build
|
||||
- build_module:
|
||||
command: "make APXS=/usr/bin/apxs"
|
||||
- verify:
|
||||
command: "ls -la modules/mod_reqin_log.so"
|
||||
- upload_artifact: actions/upload-artifact@v4
|
||||
- name: build-debian
|
||||
image: "debian:stable"
|
||||
steps:
|
||||
- checkout: actions/checkout@v4
|
||||
- install_deps:
|
||||
- build-essential
|
||||
- apache2
|
||||
- apache2-dev
|
||||
- build_module:
|
||||
command: "make APXS=/usr/bin/apxs"
|
||||
- verify:
|
||||
command: "ls -la modules/mod_reqin_log.so"
|
||||
- upload_artifact: actions/upload-artifact@v4
|
||||
Build all packages (1 DEB + 3 RPMs) using Dockerfile.package with multi-stage build.
|
||||
dockerfile: Dockerfile.package
|
||||
artifacts:
|
||||
- dist/deb/*.deb
|
||||
- dist/rpm/*.el7.*.rpm
|
||||
- dist/rpm/*.el8.*.rpm
|
||||
- dist/rpm/*.el9.*.rpm
|
||||
|
||||
- name: test
|
||||
description: >
|
||||
Run unit tests (C with cmocka) inside Docker containers.
|
||||
Integration tests require a running Apache instance.
|
||||
jobs:
|
||||
- name: unit-tests
|
||||
image: "rockylinux:8"
|
||||
steps:
|
||||
- checkout: actions/checkout@v4
|
||||
- install_deps:
|
||||
- gcc
|
||||
- make
|
||||
- httpd
|
||||
- httpd-devel
|
||||
- apr-devel
|
||||
- apr-util-devel
|
||||
- cmake
|
||||
- git
|
||||
- pkgconfig
|
||||
- libxml2-devel
|
||||
- build_cmocka:
|
||||
description: "Build cmocka from source (not available in EPEL)"
|
||||
command: |
|
||||
cd /tmp && git clone https://git.cryptomilk.org/projects/cmocka.git
|
||||
cd cmocka && git checkout cmocka-1.1.5
|
||||
mkdir build && cd build
|
||||
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
|
||||
make && make install && ldconfig
|
||||
- build_tests:
|
||||
command: |
|
||||
mkdir -p build/tests
|
||||
cd build/tests && cmake ../../ && make
|
||||
- run_tests:
|
||||
command: "cd build/tests && ctest --output-on-failure"
|
||||
dockerfile: Dockerfile.tests
|
||||
execution: ctest --output-on-failure
|
||||
|
||||
- name: package
|
||||
- name: verify
|
||||
description: >
|
||||
Build RPM and DEB packages for mod_reqin_log using Docker and fpm.
|
||||
Both packages are built from a single Dockerfile.package with multi-stage build.
|
||||
dockerfile: Dockerfile.package
|
||||
stages:
|
||||
- name: builder
|
||||
description: >
|
||||
Compile mod_reqin_log.so as Apache 2.4 module using apxs.
|
||||
- name: package_builder
|
||||
description: >
|
||||
Install fpm, rpm, dpkg-dev, apache2-dev. Create filesystem layout
|
||||
and run fpm to generate both DEB and RPM packages.
|
||||
- name: output
|
||||
description: >
|
||||
Minimal Alpine image with packages in /packages/deb and /packages/rpm.
|
||||
files:
|
||||
module:
|
||||
source: build/mod_reqin_log.so
|
||||
dest: /usr/lib/apache2/modules/mod_reqin_log.so
|
||||
mode: "0755"
|
||||
config:
|
||||
- source: conf/mod_reqin_log.conf
|
||||
dest: /etc/apache2/conf-available/mod_reqin_log.conf
|
||||
mode: "0644"
|
||||
config_file: true
|
||||
dependencies:
|
||||
deb:
|
||||
- apache2
|
||||
rpm:
|
||||
- httpd
|
||||
outputs:
|
||||
deb:
|
||||
name: libapache2-mod-reqin-log
|
||||
path: dist/deb/libapache2-mod-reqin-log_${VERSION}_amd64.deb
|
||||
rpm:
|
||||
name: mod_reqin_log
|
||||
path: dist/rpm/mod_reqin_log-${VERSION}-1.x86_64.rpm
|
||||
verify:
|
||||
deb:
|
||||
command: docker run --rm -v $(pwd)/dist/deb:/packages debian:latest sh -c "apt-get update && apt-get install -y /packages/*.deb"
|
||||
rpm:
|
||||
command: docker run --rm -v $(pwd)/dist/rpm:/packages rockylinux:8 sh -c "dnf install -y /packages/*.rpm"
|
||||
|
||||
artifacts:
|
||||
retention:
|
||||
policy: "Keep build logs and packages for 30 days for debugging"
|
||||
outputs:
|
||||
- type: module
|
||||
path: "modules/mod_reqin_log.so"
|
||||
- type: rpm
|
||||
path: "dist/rpm/"
|
||||
- type: deb
|
||||
path: "dist/deb/"
|
||||
Verify package installation on each target distribution.
|
||||
jobs:
|
||||
- name: verify-rpm-el7
|
||||
image: centos:7
|
||||
vault_repos: true
|
||||
check: "httpd -M | grep reqin_log"
|
||||
- name: verify-rpm-el8
|
||||
image: rockylinux:8
|
||||
check: "httpd -M | grep reqin_log"
|
||||
- name: verify-rpm-el9
|
||||
image: rockylinux:9
|
||||
check: "httpd -M | grep reqin_log"
|
||||
- name: verify-deb
|
||||
image: debian:stable
|
||||
check: "ls -la /usr/lib/apache2/modules/mod_reqin_log.so"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user