From 7f87b0aebd57da98c6e066674d1c2fbc0d9aa431 Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Wed, 3 Apr 2024 22:17:43 +0400 Subject: [PATCH] cicd: fix failed builds - fix broken packages issue for Postgres 15 - add Postrges 16 to the test matrix - add CentOS 8 to the test matrix - bump Zabbix Server version from 6.2.6 to 6.2.9 --- .github/workflows/mamonsu-tests-dev.yml | 23 +++++++++++++++++----- .github/workflows/mamonsu-tests-master.yml | 22 ++++++++++++++++----- github-actions-tests/tests.sh | 6 +++++- 3 files changed, 40 insertions(+), 11 deletions(-) diff --git a/.github/workflows/mamonsu-tests-dev.yml b/.github/workflows/mamonsu-tests-dev.yml index 270771ac..71e37693 100644 --- a/.github/workflows/mamonsu-tests-dev.yml +++ b/.github/workflows/mamonsu-tests-dev.yml @@ -26,9 +26,22 @@ jobs: MAMONSU_PATH: '/home/runner/work/mamonsu/mamonsu/' strategy: matrix: - docker_os: ['centos:7'] - zabbix_version: ['6.2.6'] - pg_version: ['12', '13', '14', '15', '16'] + docker_os: ['centos:7', 'centos:8'] + zabbix_version: ['6.2.9'] + pg_version: ['12', '13', '14', '15'] + include: + - docker_os: 'centos:8' + pg_version: '16' + zabbix_version: '6.2.9' + exclude: + - docker_os: 'centos:8' + pg_version: '12' + - docker_os: 'centos:8' + pg_version: '13' + - docker_os: 'centos:8' + pg_version: '14' + - docker_os: 'centos:8' + pg_version: '15' steps: - name: Checkout mamonsu repo @@ -36,7 +49,7 @@ jobs: - name: Install docker-compose run: sudo apt-get update - - run: sudo rm /usr/local/bin/docker-compose + - run: sudo rm -f /usr/local/bin/docker-compose - run: curl -L https://github.com/docker/compose/releases/download/${{ env.DOCKER_COMPOSE_VERSION }}/docker-compose-`uname -s`-`uname -m` > docker-compose - run: chmod +x docker-compose - run: sudo mv docker-compose /usr/local/bin @@ -91,4 +104,4 @@ jobs: run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) bash /mamonsu/github-actions-tests/metrics.sh --pg-version="${{ matrix.pg_version }}" --os="${{ matrix.docker_os }}" - name: Test Mamonsu removal - run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) bash /mamonsu/github-actions-tests/mamonsu_removal.sh --os="${{ matrix.docker_os }}" \ No newline at end of file + run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) bash /mamonsu/github-actions-tests/mamonsu_removal.sh --os="${{ matrix.docker_os }}" diff --git a/.github/workflows/mamonsu-tests-master.yml b/.github/workflows/mamonsu-tests-master.yml index 17c89980..cedc16ea 100644 --- a/.github/workflows/mamonsu-tests-master.yml +++ b/.github/workflows/mamonsu-tests-master.yml @@ -26,15 +26,27 @@ jobs: MAMONSU_PATH: '/home/runner/work/mamonsu/mamonsu/' strategy: matrix: - docker_os: ['ubuntu:20.04', 'centos:7'] - zabbix_version: ['4.0.44', '4.4.10', '5.0.30', '5.4.12', '6.0.12', '6.2.6'] - pg_version: ['12', '13', '14', '15', '16'] + docker_os: ['ubuntu:20.04', 'centos:7', 'centos:8'] + zabbix_version: ['4.0.44', '4.4.10', '5.0.30', '5.4.12', '6.0.12', '6.2.9'] + pg_version: ['12', '13', '14', '15'] + include: + - docker_os: 'centos:8' + pg_version: '16' + zabbix_version: '6.2.9' exclude: # excludes PG 15, 16 on CentOS - docker_os: 'centos:7' pg_version: '15' - docker_os: 'centos:7' pg_version: '16' + - docker_os: 'centos:8' + pg_version: '12' + - docker_os: 'centos:8' + pg_version: '13' + - docker_os: 'centos:8' + pg_version: '14' + - docker_os: 'centos:8' + pg_version: '15' steps: - name: Checkout mamonsu repo @@ -42,7 +54,7 @@ jobs: - name: Install docker-compose run: sudo apt-get update - - run: sudo rm /usr/local/bin/docker-compose + - run: sudo rm -f /usr/local/bin/docker-compose - run: curl -L https://github.com/docker/compose/releases/download/${{ env.DOCKER_COMPOSE_VERSION }}/docker-compose-`uname -s`-`uname -m` > docker-compose - run: chmod +x docker-compose - run: sudo mv docker-compose /usr/local/bin @@ -97,4 +109,4 @@ jobs: run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) bash /mamonsu/github-actions-tests/metrics.sh --pg-version="${{ matrix.pg_version }}" --os="${{ matrix.docker_os }}" - name: Test Mamonsu removal - run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) bash /mamonsu/github-actions-tests/mamonsu_removal.sh --os="${{ matrix.docker_os }}" \ No newline at end of file + run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) bash /mamonsu/github-actions-tests/mamonsu_removal.sh --os="${{ matrix.docker_os }}" diff --git a/github-actions-tests/tests.sh b/github-actions-tests/tests.sh index 7f453712..8374448e 100644 --- a/github-actions-tests/tests.sh +++ b/github-actions-tests/tests.sh @@ -43,13 +43,16 @@ if [ "${OS}" = "centos:7" ]; then eval "${PACKAGE_MANAGER_INSTALL} wget" eval "${PACKAGE_MANAGER_INSTALL} bc" eval "${PACKAGE_MANAGER_INSTALL} unzip" - REPO=${PACKAGE_MANAGER_INSTALL}" https://download.postgresql.org/pub/repos/yum/reporpms/EL-"$(echo ${OS} | sed -r 's/^[^0-9]*([0-9]+).*/\1/')"-x86_64/pgdg-redhat-repo-latest.noarch.rpm" + eval "${PACKAGE_MANAGER_INSTALL} https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm" + REPO=${PACKAGE_MANAGER_INSTALL}" https://download.postgresql.org/pub/repos/yum/reporpms/EL-"$(echo ${OS} | sed -r 's/^[^0-9]*([0-9]+).*/\1/')"-x86_64/pgdg-redhat-repo-latest.noarch.rpm"\ # run tests sudo bash /mamonsu/github-actions-tests/pg_install.sh --os="${OS}" --pmi="${PACKAGE_MANAGER_INSTALL}" --repo="${REPO}" --pg-version="${PG_VERSION}" elif [ "${OS}" = "centos:8" ]; then # install and set up components missing in docker image (sudo, wget, bc, unzip) + sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* + sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* dnf update -y dnf install -y sudo PACKAGE_MANAGER_INSTALL="sudo dnf -y install" @@ -57,6 +60,7 @@ elif [ "${OS}" = "centos:8" ]; then eval "${PACKAGE_MANAGER_INSTALL} wget" eval "${PACKAGE_MANAGER_INSTALL} bc" eval "${PACKAGE_MANAGER_INSTALL} unzip" + eval "${PACKAGE_MANAGER_INSTALL} https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm" REPO=${PACKAGE_MANAGER_INSTALL}" https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm; sudo dnf -qy module disable postgresql" # run tests