Skip to content

Commit

Permalink
Mon 16454 add alma 8 to centreon collect nightly tests (#506) (#519)
Browse files Browse the repository at this point in the history
* enh(ci): Add alma8 to centreon-collect nightly

* Add job to robot-nightly workflow

* enable ci test branch

* Update robot nightly workflow

* add debug to get-packages

* Add release to github_env

* add delivery test

* Get pkg dir version name

* Fix url

* fix url

* make curl silent

* fix curl

* add mariadb client

* update get-packages

* disable nightly on alma 8

* update alma8 image

* Add MariaDB packages to alma8 dockerfile

* remove extra sudo

* update collect-test-robot.sh

* Remove duplicate Robot test job

* fix(ci/tests): attempt to upgrade grpc python library

* Install proper grpc version based on OS version id

* help cmake to find protoc

* disable delivery tests

* remove unused lines from actions

* Remove more unused lines

Co-authored-by: David Boucher <dboucher@centreon.com>
  • Loading branch information
tuntoja and bouda1 committed Mar 14, 2023
1 parent bdfb545 commit d7ef352
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 9 deletions.
14 changes: 11 additions & 3 deletions .github/actions/get-packages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,24 @@ runs:
esac
FILES="centreon-broker centreon-broker-cbd centreon-broker-cbmod centreon-broker-core centreon-broker-storage centreon-clib centreon-collect centreon-collect-client centreon-connector centreon-connector-perl centreon-connector-ssh centreon-engine centreon-engine-daemon centreon-engine-extcommands"
FULL_VERSION="${{ inputs.version }}.${{ inputs.patch }}"
#RELEASE="1668587986.332470bb4948f05263630f26f7b507c9e388ed98"
RELEASE="${{ inputs.release }}"
echo "[DEBUG] - FULL_VERSION: $FULL_VERSION"
echo "[DEBUG] - RELEASE: $RELEASE"
# Obtain latest version.patch-release
PKG_DIR_VERSION=$(curl -s "https://yum.centreon.com/standard/23.04/el7/unstable/x86_64/centreon-collect/" | sed -En 's/.*([2-9][0-9]\.[0-9][0-9]\.[[:digit:]]+-[[:digit:]]+\.[[a-z0-9]{7}).*/\1/p')
echo "[DEBUG] - PKG_DIR_VERSION: $PKG_DIR_VERSION"
# Fetch files from repo
for FILE in $FILES ; do
if [[ "${{ env.extfile }}" == "deb" ]] ; then
echo "[DEBUG] - https://artifactory.apps.centreon.com/artifactory/debian-$VERSION-$REPO/pool/$FILE;deb.distribution=bullseye;deb.component=main;deb.architecture=amd64"
curl -v -u "${{ inputs.repos_username }}":"${{ inputs.repos_password }}" -X PUT "https://artifactory.apps.centreon.com/artifactory/debian-$VERSION-$REPO/pool/$FILE;deb.distribution=bullseye;deb.component=main;deb.architecture=amd64" -T "./$FILE"
else
echo "[DEBUG] - https://artifactory.apps.centreon.com/artifactory/rpm-${{ inputs.version }}-$REPO/${{ inputs.distrib }}/$REPO/x86_64/centreon-collect/$FILE-$FULL_VERSION-$RELEASE.${{ inputs.distrib }}.x86_64.rpm"
curl -v -u "${{ inputs.repos_username }}":"${{ inputs.repos_password }}" -O "https://artifactory.apps.centreon.com/artifactory/rpm-${{ inputs.version }}-$REPO/${{ inputs.distrib }}/$REPO/x86_64/centreon-collect/$FILE-$FULL_VERSION-$RELEASE.${{ inputs.distrib }}.x86_64.rpm"
echo "[DEBUG] - https://yum.centreon.com/standard/${{ inputs.version }}/${{ inputs.distrib }}/$REPO/x86_64/centreon-collect/$PKG_DIR_VERSION/$FILE-$PKG_DIR_VERSION.${{ inputs.distrib }}.x86_64.rpm"
curl -s -JO "https://yum.centreon.com/standard/${{ inputs.version }}/${{ inputs.distrib }}/$REPO/x86_64/centreon-collect/centreon-collect-$PKG_DIR_VERSION/$FILE-$PKG_DIR_VERSION.${{ inputs.distrib }}.x86_64.rpm"
fi
done
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/robot-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
- image: centreon-collect-centos7
distrib: el7
folder_report: tests/
- image: centreon-collect-alma8
distrib: el8
folder_report: tests/
steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand All @@ -44,7 +47,8 @@ jobs:
echo "release=$GITHUB_RUN_ATTEMPT" >> $GITHUB_ENV
;;
*)
echo "release=${{ github.sha }}" >> $GITHUB_ENV
echo "release=`date +%s`.`echo ${{ github.sha }} | cut -c -7`" >> $GITHUB_OUTPUT
echo "release=`date +%s`.`echo ${{ github.sha }} | cut -c -7`" >> $GITHUB_ENV
;;
esac
shell: bash
Expand All @@ -67,7 +71,7 @@ jobs:
username: ${{ secrets.REPOS_USERNAME }}
password: ${{ secrets.REPOS_PASSWORD }}

- name: Test robot Centos7
- name: Tests robot (Centos7, Alma8)
uses: ./.github/actions/runner-docker
with:
script_name: /src/ci/scripts/collect-test-robot
Expand Down
7 changes: 6 additions & 1 deletion ci/docker/Dockerfile.collect-alma8
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ RUN dnf config-manager --set-enabled powertools
RUN curl -o centreon-release.rpm "http://yum-1.centreon.com/standard/21.10/el8/stable/noarch/RPMS/centreon-release-21.10-1.el8.noarch.rpm"
RUN dnf install --nogpgcheck centreon-release.rpm
RUN dnf config-manager --set-enabled 'centreon-testing*'
RUN curl -LsS "https://r.mariadb.com/downloads/mariadb_repo_setup" | bash -s -- --os-type=rhel --os-version=8 --mariadb-server-version="mariadb-10.5"
RUN dnf clean all && dnf install -y cmake \
gcc \
gcc-c++ \
gettext \
git \
MariaDB-devel \
MariaDB-shared \
MariaDB-client \
MariaDB-compat \
MariaDB-common \
MariaDB-server \
gnutls-devel \
libgcrypt-devel \
libssh2-devel \
Expand All @@ -31,7 +37,6 @@ RUN dnf clean all && dnf install -y cmake \
rpm-build \
rrdtool-devel \
yum-utils \
MariaDB-shared \
perl \
rpm-build
RUN dnf update libarchive
Expand Down
23 changes: 20 additions & 3 deletions ci/scripts/collect-test-robot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,26 @@ echo "########################### Install Robot Framework ######################
cd /src/tests/
pip3 install -U robotframework robotframework-databaselibrary pymysql python-dateutil

yum install "Development Tools" python3-devel -y

pip3 install grpcio==1.33.2 grpcio_tools==1.33.2
yum groupinstall "Development Tools" -y
yum install python3-devel -y

# Get OS version id
VERSION_ID=$(grep '^VERSION_ID' /etc/os-release | sed -En 's/^VERSION_ID="([[:digit:]])\.[[:digit:]]"/\1/p')

# Force version for el7 only
if [ -f /etc/os-release ]; then
case "$VERSION_ID" in
7)
pip3 install grpcio==1.33.2 grpcio_tools==1.33.2
;;
8)
pip3 install grpcio grpcio_tools
;;
*)
echo "OS Version is neither 7 or 8"
;;
esac
fi

./init-proto.sh

Expand Down

0 comments on commit d7ef352

Please sign in to comment.