Skip to content

Commit

Permalink
Merge pull request #2164 from wazuh/2154-deprecate-centos6-debian7
Browse files Browse the repository at this point in the history
Deprecate CentOS 6 and Debian 7 on Wazuh Manager compilation
  • Loading branch information
vikman90 authored Nov 9, 2023
2 parents 48263fb + 37383a2 commit f195c56
Show file tree
Hide file tree
Showing 18 changed files with 323 additions and 157 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/build-deb-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,39 +37,43 @@ jobs:
deb_images:
- 'debs/Debian/**'
- 'debs/build.sh'
deb_images_i386:
- 'debs/Debian/i386/**'
deb_images_agent_i386:
- 'debs/Debian/7/i386/**'
- 'debs/build.sh'
deb_images_amd64:
- 'debs/Debian/amd64/**'
deb_images_manager_amd64:
- 'debs/Debian/8/amd64/**'
- 'debs/build.sh'
deb_images_agent_amd64:
- 'debs/Debian/7/amd64/**'
- 'debs/build.sh'
deb_packages:
- 'debs/SPECS/**'
- 'debs/generate_debian_package.sh'
- name: Set tag and container name
if: steps.changes.outputs.deb_packages == 'true' || (steps.changes.outputs.deb_images_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.deb_images_amd64 == 'true' && matrix.ARCHITECTURE == 'amd64')
if: steps.changes.outputs.deb_packages == 'true' || (steps.changes.outputs.deb_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || ((steps.changes.outputs.deb_images_manager_amd64 == 'true' || steps.changes.outputs.deb_images_agent_amd64 == 'true') && matrix.ARCHITECTURE == 'amd64')
run: |
MAJOR=$(sed 's/\([0-9]*\.[0-9]*\)\.[0-9]*/\1/' $GITHUB_WORKSPACE/VERSION)
if [ "${{ steps.changes.outputs.deb_images }}" == "true" ]; then echo "TAG=${{ github.head_ref }}" >> $GITHUB_ENV; else echo "TAG=$MAJOR" >> $GITHUB_ENV ; fi
if [ $MAJOR == "4.9" ]; then echo "VERSION=master" >> $GITHUB_ENV ; else echo "VERSION=$(cat $GITHUB_WORKSPACE/VERSION)" >> $GITHUB_ENV; fi
echo "CONTAINER_NAME=deb_builder_${{ matrix.ARCHITECTURE }}" >> $GITHUB_ENV
echo "CONTAINER_NAME=deb_${{ matrix.TYPE }}_builder_${{ matrix.ARCHITECTURE }}" >> $GITHUB_ENV
if [ "${{ matrix.ARCHITECTURE }}" == "amd64" ]; then echo "CONTAINER_NAME=deb_${{ matrix.TYPE }}_builder_${{ matrix.ARCHITECTURE }}" >> $GITHUB_ENV ; else echo "CONTAINER_NAME=deb_${{ matrix.TYPE }}_builder_${{ matrix.ARCHITECTURE }}" >> $GITHUB_ENV ; fi
- name: Download docker image for package building
if: steps.changes.outputs.deb_packages == 'true' || (steps.changes.outputs.deb_images_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.deb_images_amd64 == 'true' && matrix.ARCHITECTURE == 'amd64')
if: steps.changes.outputs.deb_packages == 'true' || (steps.changes.outputs.deb_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || ((steps.changes.outputs.deb_images_manager_amd64 == 'true' || steps.changes.outputs.deb_images_agent_amd64 == 'true') && matrix.ARCHITECTURE == 'amd64')
run: |
bash $GITHUB_WORKSPACE/.github/actions/ghcr-pull-and-push/pull_image_from_ghcr.sh ${{ secrets.GITHUB_TOKEN }} ${{ github.actor}} $CONTAINER_NAME ${{ env.TAG }}
- name: Build the ${{ matrix.ARCHITECTURE }} deb Wazuh ${{ matrix.TYPE }} package
if: steps.changes.outputs.deb_packages == 'true' || (steps.changes.outputs.deb_images_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.deb_images_amd64 == 'true' && matrix.ARCHITECTURE == 'amd64')
if: steps.changes.outputs.deb_packages == 'true' || (steps.changes.outputs.deb_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || ((steps.changes.outputs.deb_images_manager_amd64 == 'true' || steps.changes.outputs.deb_images_agent_amd64 == 'true') && matrix.ARCHITECTURE == 'amd64')
working-directory: ./debs
run: |
REVISION="${{ github.head_ref }}"
bash generate_debian_package.sh -b ${{ env.VERSION }} -t ${{ matrix.TYPE }} -a ${{ matrix.ARCHITECTURE }} --dev -j 2 --dont-build-docker --tag ${{ env.TAG }} -r $REVISION
echo "PACKAGE_NAME=$(ls ./output | grep .deb | head -n 1)" >> $GITHUB_ENV
- name: Upload Wazuh ${{ matrix.TYPE }} ${{ matrix.ARCHITECTURE }} package as artifact
if: steps.changes.outputs.deb_packages == 'true' || (steps.changes.outputs.deb_images_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.deb_images_amd64 == 'true' && matrix.ARCHITECTURE == 'amd64')
if: steps.changes.outputs.deb_packages == 'true' || (steps.changes.outputs.deb_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || ((steps.changes.outputs.deb_images_manager_amd64 == 'true' || steps.changes.outputs.deb_images_agent_amd64 == 'true') && matrix.ARCHITECTURE == 'amd64')
uses: actions/upload-artifact@v2
with:
name: ${{ env.PACKAGE_NAME }}
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/build-rpm-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,39 +38,42 @@ jobs:
rpm_images:
- 'rpms/CentOS/**'
- 'rpms/build.sh'
rpm_images_i386:
rpm_images_agent_i386:
- 'rpms/CentOS/6/i386/**'
- 'rpms/build.sh'
rpm_images_x86_64:
rpm_images_agent_x86_64:
- 'rpms/CentOS/6/x86_64/**'
- 'rpms/build.sh'
rpm_images_manager_x86_64:
- 'rpms/CentOS/7/x86_64/**'
- 'rpms/build.sh'
rpm_packages:
- 'rpms/SPECS/**'
- 'rpms/generate_rpm_package.sh'
- name: Set tag and container name
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.rpm_images_x86_64 == 'true' && matrix.ARCHITECTURE == 'x86_64')
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || ((steps.changes.outputs.rpm_images_manager_x86_64 == 'true' || steps.changes.outputs.rpm_images_agent_x86_64 == 'true') && matrix.ARCHITECTURE == 'x86_64')
run: |
MAJOR=$(sed 's/\([0-9]*\.[0-9]*\)\.[0-9]*/\1/' $GITHUB_WORKSPACE/VERSION)
if [ "${{ steps.changes.outputs.rpm_images }}" == "true" ]; then echo "TAG=${{ github.head_ref }}" >> $GITHUB_ENV; else echo "TAG=$MAJOR" >> $GITHUB_ENV ; fi
if [ $MAJOR == "4.9" ]; then echo "VERSION=master" >> $GITHUB_ENV ; else echo "VERSION=$(cat $GITHUB_WORKSPACE/VERSION)" >> $GITHUB_ENV; fi
if [ "${{ matrix.ARCHITECTURE }}" == "x86_64" ]; then echo "CONTAINER_NAME=rpm_builder_x86" >> $GITHUB_ENV ; else echo "CONTAINER_NAME=rpm_builder_${{ matrix.ARCHITECTURE }}" >> $GITHUB_ENV ; fi
if [ "${{ matrix.ARCHITECTURE }}" == "x86_64" ]; then echo "CONTAINER_NAME=rpm_${{ matrix.TYPE }}_builder_x86" >> $GITHUB_ENV ; else echo "CONTAINER_NAME=rpm_${{ matrix.TYPE }}_builder_${{ matrix.ARCHITECTURE }}" >> $GITHUB_ENV ; fi
- name: Download docker image for package building
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.rpm_images_x86_64 == 'true' && matrix.ARCHITECTURE == 'x86_64')
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || ((steps.changes.outputs.rpm_images_manager_x86_64 == 'true' || steps.changes.outputs.rpm_images_agent_x86_64 == 'true') && matrix.ARCHITECTURE == 'x86_64')
run: |
bash $GITHUB_WORKSPACE/.github/actions/ghcr-pull-and-push/pull_image_from_ghcr.sh ${{ secrets.GITHUB_TOKEN }} ${{ github.actor}} $CONTAINER_NAME ${{ env.TAG }}
- name: Build the ${{ matrix.ARCHITECTURE }} rpm Wazuh ${{ matrix.TYPE }} package
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.rpm_images_x86_64 == 'true' && matrix.ARCHITECTURE == 'x86_64')
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || ((steps.changes.outputs.rpm_images_manager_x86_64 == 'true' || steps.changes.outputs.rpm_images_agent_x86_64 == 'true') && matrix.ARCHITECTURE == 'x86_64')
working-directory: ./rpms
run: |
REVISION=$( echo ${{ github.head_ref }} | sed 's/-/./g' )
bash generate_rpm_package.sh -b ${{ env.VERSION }} -t ${{ matrix.TYPE }} -a ${{ matrix.ARCHITECTURE }} --dev -j 2 --dont-build-docker --tag ${{ env.TAG }} -r $REVISION
echo "PACKAGE_NAME=$(ls ./output | grep .rpm | head -n 1)" >> $GITHUB_ENV
- name: Upload Wazuh ${{ matrix.TYPE }} ${{ matrix.ARCHITECTURE }} package as artifact
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.rpm_images_x86_64 == 'true' && matrix.ARCHITECTURE == 'x86_64')
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || ((steps.changes.outputs.rpm_images_manager_x86_64 == 'true' || steps.changes.outputs.rpm_images_agent_x86_64 == 'true') && matrix.ARCHITECTURE == 'x86_64')
uses: actions/upload-artifact@v2
with:
name: ${{ env.PACKAGE_NAME }}
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/test-install-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ jobs:

Wait-for-package-building:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Cancel previous runs
uses: fkirc/skip-duplicate-actions@master
Expand Down Expand Up @@ -55,25 +53,26 @@ jobs:
deb_images:
- 'debs/Debian/**'
- 'debs/build.sh'
deb_images_i386:
- 'debs/Debian/i386/**'
deb_images_agent_i386:
- 'debs/Debian/7/i386/**'
- 'debs/build.sh'
deb_images_amd64:
- 'debs/Debian/amd64/**'
- 'debs/Debian/7/amd64/**'
- 'debs/Debian/8/amd64/**'
- 'debs/build.sh'
deb_packages:
- 'debs/SPECS/**'
- 'debs/generate_debian_package.sh'
- name: Setup directories and variables
if: steps.changes.outputs.deb_packages == 'true' || (steps.changes.outputs.deb_images_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.deb_images_amd64 == 'true' && matrix.ARCHITECTURE == 'amd64')
if: steps.changes.outputs.deb_packages == 'true' || (steps.changes.outputs.deb_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.deb_images_amd64 == 'true' && matrix.ARCHITECTURE == 'amd64')
run: |
VERSION=$(cat $GITHUB_WORKSPACE/VERSION)
REVISION=$( echo ${{ github.head_ref }})
echo "PACKAGE_NAME=wazuh-${{ matrix.type }}_${VERSION}-${REVISION}_${{ matrix.arch }}.deb" >> $GITHUB_ENV
- name: Download the Wazuh ${{ matrix.type }} package for ${{ matrix.system.NAME }}
if: steps.changes.outputs.deb_packages == 'true' || (steps.changes.outputs.deb_images_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.deb_images_amd64 == 'true' && matrix.ARCHITECTURE == 'amd64')
if: steps.changes.outputs.deb_packages == 'true' || (steps.changes.outputs.deb_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.deb_images_amd64 == 'true' && matrix.ARCHITECTURE == 'amd64')
id: download-artifact
continue-on-error: true
uses: dawidd6/action-download-artifact@v2
Expand All @@ -84,11 +83,11 @@ jobs:
if_no_artifact_found: fail

- name: Move the Wazuh ${{ matrix.type }} package for ${{ matrix.distro_name }} to the packages directory
if: steps.changes.outputs.deb_packages == 'true' || (steps.changes.outputs.deb_images_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.deb_images_amd64 == 'true' && matrix.ARCHITECTURE == 'amd64')
if: steps.changes.outputs.deb_packages == 'true' || (steps.changes.outputs.deb_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.deb_images_amd64 == 'true' && matrix.ARCHITECTURE == 'amd64')
run: |
mkdir $GITHUB_WORKSPACE/packages
mv ${{env.PACKAGE_NAME}} $GITHUB_WORKSPACE/packages
- name: Launch docker
if: steps.changes.outputs.deb_packages == 'true' || (steps.changes.outputs.deb_images_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.deb_images_amd64 == 'true' && matrix.ARCHITECTURE == 'amd64')
run: sudo docker run -v $GITHUB_WORKSPACE/.github/actions/test-install-components/:/tests -v $GITHUB_WORKSPACE/packages/:/packages ${{ matrix.arch }}/${{ matrix.distro_name }} bash /tests/install_component.sh $PACKAGE_NAME ${{ matrix.type }}
if: steps.changes.outputs.deb_packages == 'true' || (steps.changes.outputs.deb_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.deb_images_amd64 == 'true' && matrix.ARCHITECTURE == 'amd64')
run: sudo docker run -v $GITHUB_WORKSPACE/.github/actions/test-install-components/:/tests -v $GITHUB_WORKSPACE/packages/:/packages ${{ matrix.arch }}/${{ matrix.distro_name }} bash /tests/install_component.sh $PACKAGE_NAME ${{ matrix.type }}
39 changes: 19 additions & 20 deletions .github/workflows/test-install-rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ on:
jobs:
Wait-for-package-building:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Cancel previous runs
uses: fkirc/skip-duplicate-actions@master
Expand All @@ -34,18 +32,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
system: [
{NAME: 'oraclelinux:9', ARCH: "x86_64"},
{NAME: 'almalinux:9', ARCH: "x86_64"},
{NAME: 'rockylinux:9', ARCH: "x86_64"},
{NAME: 'centos:7', ARCH: "x86_64"},
{NAME: 'centos:8', ARCH: "x86_64"},
{NAME: 'i386/centos:7', ARCH: "i386"},
{NAME: 'redhat/ubi8:latest', ARCH: "x86_64"},
{NAME: 'redhat/ubi9:latest', ARCH: "x86_64"},
{NAME: 'amazonlinux:2', ARCH: "x86_64"},
{NAME: 'fedora:34', ARCH: "x86_64"},
{NAME: 'centos:6.9', ARCH: "x86_64", INIT: "initd"}]
system:
- {NAME: 'oraclelinux:9', ARCH: "x86_64"}
- {NAME: 'almalinux:9', ARCH: "x86_64"}
- {NAME: 'rockylinux:9', ARCH: "x86_64"}
- {NAME: 'centos:7', ARCH: "x86_64"}
- {NAME: 'centos:8', ARCH: "x86_64"}
- {NAME: 'i386/centos:7', ARCH: "i386"}
- {NAME: 'redhat/ubi8:latest', ARCH: "x86_64"}
- {NAME: 'redhat/ubi9:latest', ARCH: "x86_64"}
- {NAME: 'amazonlinux:2', ARCH: "x86_64"}
- {NAME: 'fedora:34', ARCH: "x86_64"}
- {NAME: 'centos:6.9', ARCH: "x86_64", INIT: "initd"}
type: [agent, manager]
exclude:
- system: {ARCH: "i386"}
Expand All @@ -64,25 +62,26 @@ jobs:
rpm_images:
- 'rpms/CentOS/**'
- 'rpms/build.sh'
rpm_images_i386:
rpm_images_agent_i386:
- 'rpms/CentOS/6/i386/**'
- 'rpms/build.sh'
rpm_images_x86_64:
- 'rpms/CentOS/6/x86_64/**'
- 'rpms/CentOS/7/x86_64/**'
- 'rpms/build.sh'
rpm_packages:
- 'rpms/SPECS/**'
- 'rpms/generate_rpm_package.sh'
- name: Setup directories and variables
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.rpm_images_x86_64 == 'true' && matrix.ARCHITECTURE == 'x86_64')
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.rpm_images_x86_64 == 'true' && matrix.ARCHITECTURE == 'x86_64')
run: |
VERSION=$(cat $GITHUB_WORKSPACE/VERSION)
REVISION=$( echo ${{ github.head_ref }} | sed 's/-/./g' )
echo "PACKAGE_NAME=wazuh-${{ matrix.type }}-${VERSION}-${REVISION}.${{matrix.system.ARCH}}.rpm" >> $GITHUB_ENV
- name: Download the Wazuh ${{ matrix.type }} package for ${{ matrix.system.NAME }}
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.rpm_images_x86_64 == 'true' && matrix.ARCHITECTURE == 'x86_64')
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.rpm_images_x86_64 == 'true' && matrix.ARCHITECTURE == 'x86_64')
id: download-artifact
continue-on-error: true
uses: dawidd6/action-download-artifact@v2
Expand All @@ -93,11 +92,11 @@ jobs:
if_no_artifact_found: fail

- name: Move the Wazuh ${{ matrix.type }} package for ${{ matrix.system.NAME }} to the packages directory
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.rpm_images_x86_64 == 'true' && matrix.ARCHITECTURE == 'x86_64')
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.rpm_images_x86_64 == 'true' && matrix.ARCHITECTURE == 'x86_64')
run: |
mkdir $GITHUB_WORKSPACE/packages
mv ${{env.PACKAGE_NAME}} $GITHUB_WORKSPACE/packages
- name: Launch docker
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.rpm_images_x86_64 == 'true' && matrix.ARCHITECTURE == 'x86_64')
run: sudo docker run -v $GITHUB_WORKSPACE/.github/actions/test-install-components/:/tests -v $GITHUB_WORKSPACE/packages/:/packages ${{ matrix.system.NAME }} bash /tests/install_component.sh $PACKAGE_NAME ${{ matrix.type }}
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.rpm_images_x86_64 == 'true' && matrix.ARCHITECTURE == 'x86_64')
run: sudo docker run -v $GITHUB_WORKSPACE/.github/actions/test-install-components/:/tests -v $GITHUB_WORKSPACE/packages/:/packages ${{ matrix.system.NAME }} bash /tests/install_component.sh $PACKAGE_NAME ${{ matrix.type }}
Loading

0 comments on commit f195c56

Please sign in to comment.