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:
67
Makefile
67
Makefile
@ -72,41 +72,64 @@ debug: clean all
|
||||
|
||||
# =============================================================================
|
||||
# Packaging (DEB + RPM with Docker + fpm)
|
||||
# Dockerfile.package builds all packages in a single multi-stage build:
|
||||
# - 1 DEB package (Debian/Ubuntu)
|
||||
# - 3 RPM packages (el7, el8, el9 for RHEL/CentOS/Rocky compatibility)
|
||||
# =============================================================================
|
||||
|
||||
## package: Build all packages (deb + rpm)
|
||||
package: package-deb package-rpm
|
||||
|
||||
## package-deb: Build DEB package (requires Docker)
|
||||
package-deb:
|
||||
## package: Build all packages (deb + rpm for el7, el8, el9)
|
||||
package:
|
||||
mkdir -p $(DIST_DIR)/deb $(DIST_DIR)/rpm
|
||||
docker build --target output -t mod_reqin_log-packager:latest \
|
||||
docker build --target output -t mod_reqin_log:packager \
|
||||
--build-arg VERSION=$(VERSION) \
|
||||
-f Dockerfile.package .
|
||||
@echo "Extracting packages from Docker image..."
|
||||
docker run --rm -v $(PWD)/$(DIST_DIR):/output mod_reqin_log-packager:latest \
|
||||
sh -c 'cp -r /packages/deb /output/deb/ && cp -r /packages/rpm /output/rpm/'
|
||||
@echo "DEB packages created:"
|
||||
ls -la $(DIST_DIR)/deb/
|
||||
@echo "RPM packages created:"
|
||||
ls -la $(DIST_DIR)/rpm/
|
||||
docker run --rm -v $(PWD)/$(DIST_DIR):/output mod_reqin_log:packager \
|
||||
sh -c 'cp -r /packages/deb/* /output/deb/ && cp -r /packages/rpm/* /output/rpm/'
|
||||
@echo "Packages created:"
|
||||
@echo " DEB:"
|
||||
@ls -la $(DIST_DIR)/deb/
|
||||
@echo " RPM (el7, el8, el9):"
|
||||
@ls -la $(DIST_DIR)/rpm/
|
||||
|
||||
## package-rpm: Build RPM package (requires Docker)
|
||||
package-rpm: package-deb
|
||||
@echo "RPM built together with DEB in Dockerfile.package"
|
||||
## package-deb: Build DEB package (built together with RPMs in Dockerfile.package)
|
||||
package-deb: package
|
||||
@echo "DEB package built together with RPMs in Dockerfile.package"
|
||||
|
||||
## package-rpm: Build RPM packages (el7, el8, el9 built together in Dockerfile.package)
|
||||
package-rpm: package
|
||||
@echo "RPM packages built together with DEB in Dockerfile.package"
|
||||
|
||||
## test-package-deb: Test DEB package installation in Docker
|
||||
test-package-deb: package-deb
|
||||
test-package-deb: package
|
||||
docker run --rm -v $(PWD)/$(DIST_DIR)/deb:/packages:ro debian:latest \
|
||||
sh -c "apt-get update && apt-get install -y /packages/*.deb && echo 'DEB install OK'"
|
||||
|
||||
## test-package-rpm: Test RPM package installation in Docker
|
||||
test-package-rpm: package-deb
|
||||
## test-package-rpm: Test RPM package installation in Docker (tests el9 by default)
|
||||
test-package-rpm: package
|
||||
docker run --rm -v $(PWD)/$(DIST_DIR)/rpm:/packages:ro rockylinux:9 \
|
||||
sh -c "dnf install -y /packages/*.el9.*.rpm && echo 'RPM el9 install OK'"
|
||||
|
||||
## test-package-rpm-el7: Test el7 RPM installation
|
||||
test-package-rpm-el7: package
|
||||
docker run --rm -v $(PWD)/$(DIST_DIR)/rpm:/packages:ro 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/*.el7.*.rpm && echo 'RPM el7 install OK'"
|
||||
|
||||
## test-package-rpm-el8: Test el8 RPM installation
|
||||
test-package-rpm-el8: package
|
||||
docker run --rm -v $(PWD)/$(DIST_DIR)/rpm:/packages:ro rockylinux:8 \
|
||||
sh -c "dnf install -y /packages/*.rpm && echo 'RPM install OK'"
|
||||
sh -c "dnf install -y /packages/*.el8.*.rpm && echo 'RPM el8 install OK'"
|
||||
|
||||
## test-package-rpm-el9: Test el9 RPM installation
|
||||
test-package-rpm-el9: package
|
||||
docker run --rm -v $(PWD)/$(DIST_DIR)/rpm:/packages:ro rockylinux:9 \
|
||||
sh -c "dnf install -y /packages/*.el9.*.rpm && echo 'RPM el9 install OK'"
|
||||
|
||||
## test-package: Test all packages installation
|
||||
test-package: test-package-deb test-package-rpm
|
||||
test-package: test-package-deb test-package-rpm-el7 test-package-rpm-el8 test-package-rpm-el9
|
||||
|
||||
# Help target
|
||||
help:
|
||||
@ -119,9 +142,9 @@ help:
|
||||
@echo " clean - Remove build artifacts"
|
||||
@echo " test - Run unit tests"
|
||||
@echo " debug - Build with debug symbols"
|
||||
@echo " package - Build all packages (deb + rpm)"
|
||||
@echo " package - Build all packages (deb + rpm for el7, el8, el9)"
|
||||
@echo " package-deb - Build DEB package"
|
||||
@echo " package-rpm - Build RPM package"
|
||||
@echo " package-rpm - Build RPM packages"
|
||||
@echo " test-package - Test package installation"
|
||||
@echo ""
|
||||
@echo "Variables:"
|
||||
|
||||
Reference in New Issue
Block a user