refactor: Remove RedHat/CentOS support, focus on Ubuntu/Debian
BREAKING CHANGE: Removed RedHat/CentOS/Rocky Linux support to improve stability - Remove all RedHat/CentOS-specific code and variables - Consolidate Ubuntu/Debian variables into single debian-family.yml - Simplify CI/CD pipeline (remove CentOS tests) - Remove unstable multi-OS complexity - Update documentation to reflect Ubuntu/Debian focus - Streamline playbooks for better maintainability This change makes the project more stable and maintainable by focusing on the most common server distributions (Ubuntu/Debian) instead of trying to support multiple OS families with different package managers and configurations.
This commit is contained in:
98
.github/workflows/ci-cd.yml
vendored
98
.github/workflows/ci-cd.yml
vendored
@@ -178,101 +178,7 @@ jobs:
|
||||
docker stop test-server || true
|
||||
docker rm test-server || true
|
||||
|
||||
test-centos:
|
||||
name: Test on CentOS Stream
|
||||
runs-on: ubuntu-latest
|
||||
needs: lint
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install Ansible
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install ansible
|
||||
|
||||
- name: Set up Docker
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Create test inventory
|
||||
run: |
|
||||
mkdir -p test-inventory
|
||||
cat > test-inventory/hosts <<EOF
|
||||
[wordpress_servers]
|
||||
test-centos ansible_host=localhost ansible_port=2223 ansible_user=testuser ansible_ssh_private_key_file=~/.ssh/id_rsa ansible_ssh_common_args='-o StrictHostKeyChecking=no'
|
||||
EOF
|
||||
|
||||
- name: Build CentOS test container
|
||||
run: |
|
||||
docker build -t test-centos:stream9 -f- . <<EOF
|
||||
FROM quay.io/centos/centos:stream9
|
||||
RUN dnf update -y && dnf install -y \
|
||||
python3 python3-pip sudo openssh-server --allowerasing \
|
||||
&& dnf clean all
|
||||
RUN useradd -m -s /bin/bash testuser && \
|
||||
echo 'testuser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
||||
# Configure SSH
|
||||
RUN mkdir /var/run/sshd
|
||||
RUN echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
|
||||
RUN echo 'PasswordAuthentication no' >> /etc/ssh/sshd_config
|
||||
RUN echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config
|
||||
RUN ssh-keygen -A
|
||||
EXPOSE 22
|
||||
# Start SSH service in foreground to keep container running
|
||||
CMD ["/usr/sbin/sshd", "-D"]
|
||||
EOF
|
||||
|
||||
- name: Run CentOS test container
|
||||
run: |
|
||||
# Generate SSH key (reuse from Ubuntu test)
|
||||
mkdir -p ~/.ssh
|
||||
if [ ! -f ~/.ssh/id_rsa ]; then
|
||||
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N ""
|
||||
fi
|
||||
|
||||
# Start container
|
||||
docker run -d --name test-centos \
|
||||
-p 2223:22 \
|
||||
test-centos:stream9
|
||||
|
||||
# Wait for SSH to be ready
|
||||
sleep 10
|
||||
|
||||
# Copy SSH key to container
|
||||
docker exec test-centos mkdir -p /home/testuser/.ssh
|
||||
docker cp ~/.ssh/id_rsa.pub test-centos:/home/testuser/.ssh/authorized_keys
|
||||
docker exec test-centos chown -R testuser:testuser /home/testuser/.ssh
|
||||
docker exec test-centos chmod 700 /home/testuser/.ssh
|
||||
docker exec test-centos chmod 600 /home/testuser/.ssh/authorized_keys
|
||||
|
||||
# Test if container is running
|
||||
if ! docker ps | grep -q test-centos; then
|
||||
echo "CentOS container failed to start, checking logs:"
|
||||
docker logs test-centos
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Test LEMP installation on CentOS
|
||||
run: |
|
||||
# Just test syntax and basic functionality for CentOS
|
||||
ansible-playbook -i test-inventory/hosts \
|
||||
playbooks/lemp-wordpress-multios.yml \
|
||||
--extra-vars "mysql_root_password=test123 wordpress_db_password=test123 wp_admin_password=test123" \
|
||||
--check \
|
||||
-v
|
||||
continue-on-error: true
|
||||
|
||||
- name: Cleanup CentOS
|
||||
if: always()
|
||||
run: |
|
||||
docker stop test-centos || true
|
||||
docker rm test-centos || true
|
||||
|
||||
|
||||
security-scan:
|
||||
name: Security Scanning
|
||||
@@ -302,7 +208,7 @@ jobs:
|
||||
release:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test-ubuntu, test-centos, security-scan]
|
||||
needs: [test-ubuntu, security-scan]
|
||||
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
Reference in New Issue
Block a user