docs: update architecture.yml with unified packaging section
- Update CI package stage to use Dockerfile.package with fpm - Replace rpmbuild and debhelper with unified fpm approach - Document multi-stage build pipeline (builder, package_builder, output) - Add file mappings, dependencies, and verification commands Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@ -440,47 +440,47 @@ ci:
|
||||
|
||||
- name: package
|
||||
description: >
|
||||
Build RPM and DEB packages for mod_reqin_log inside Docker.
|
||||
jobs:
|
||||
- name: rpm-rocky-8
|
||||
image: "rockylinux:8"
|
||||
steps:
|
||||
- install_deps:
|
||||
- rpm-build
|
||||
- rpmlint
|
||||
- gcc
|
||||
- make
|
||||
- httpd
|
||||
- httpd-devel
|
||||
- create_tarball:
|
||||
command: "tar -czf mod_reqin_log-1.0.0.tar.gz --transform 's,^,mod_reqin_log-1.0.0/,' ."
|
||||
- setup_rpmbuild:
|
||||
command: |
|
||||
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
|
||||
cp mod_reqin_log-1.0.0.tar.gz ~/rpmbuild/SOURCES/
|
||||
cp packaging/rpm/mod_reqin_log.spec ~/rpmbuild/SPECS/
|
||||
- build_rpm:
|
||||
command: "rpmbuild -ba ~/rpmbuild/SPECS/mod_reqin_log.spec"
|
||||
- upload_artifact:
|
||||
paths: "~/rpmbuild/RPMS/x86_64/*.rpm"
|
||||
- name: deb-debian
|
||||
image: "debian:stable"
|
||||
steps:
|
||||
- install_deps:
|
||||
- build-essential
|
||||
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
|
||||
- apache2-dev
|
||||
- debhelper
|
||||
- devscripts
|
||||
- dpkg-dev
|
||||
- setup_package:
|
||||
command: |
|
||||
cp -r packaging/deb/* ./debian/
|
||||
# Create changelog
|
||||
- build_deb:
|
||||
command: "debuild -us -uc -b"
|
||||
- upload_artifact:
|
||||
paths: "../*.deb"
|
||||
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:
|
||||
@ -489,7 +489,7 @@ ci:
|
||||
- type: module
|
||||
path: "modules/mod_reqin_log.so"
|
||||
- type: rpm
|
||||
path: "~/rpmbuild/RPMS/x86_64/"
|
||||
path: "dist/rpm/"
|
||||
- type: deb
|
||||
path: "../"
|
||||
path: "dist/deb/"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user