Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): deliver to unstable after nightly robot #557

Merged
merged 117 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
9c9b843
fix(tests/ci): attempt to find grpc in tests
bouda1 Feb 2, 2023
36ae149
fix(github/robot): patch so that robot works without compiling everyt…
bouda1 Feb 2, 2023
5a02f28
fix(ci/tests): distrib updated
bouda1 Feb 2, 2023
12f89b0
wip(robot)
bouda1 Feb 2, 2023
e396b6f
fix(ci/tests): wip
bouda1 Feb 3, 2023
84ec378
fix(ci/tests): wip1
bouda1 Feb 3, 2023
0695de0
fix(ci/tests): work on pip3
bouda1 Feb 2, 2023
9a99c0f
fix(ci/tests): robot is now on alma9
bouda1 Feb 3, 2023
bd2dec4
fix(ci/tests): mysql socket set with good value
bouda1 Feb 3, 2023
77fef7c
fix(ci/tests): check to see if mariadbd is running added
bouda1 Feb 3, 2023
86ea2d8
fix(ci/tests): mariadb seems not runngin
bouda1 Feb 3, 2023
e167f18
fix(ci/tests): better path for mariadbd
bouda1 Feb 3, 2023
7212cde
fix(ci/tests): mariadb not started
bouda1 Feb 3, 2023
3d56907
fix(ci/tests): initialization of mariadbd
bouda1 Feb 3, 2023
58c690a
fix(ci/tests): attempt to deliver on success
bouda1 Feb 3, 2023
fcda27c
fix(ci/tests): just bam tests to make robot to fail
bouda1 Feb 3, 2023
2bf91b7
fix(ci/tests): typo fixed
bouda1 Feb 3, 2023
aff3774
fix(ci/tests): fix syntax error
bouda1 Feb 3, 2023
c4f3e45
fix(ci/tests): robot established as usually
bouda1 Feb 5, 2023
ac69f68
enh(ci/package): new package-collect as a reusable workflow
bouda1 Feb 6, 2023
1209cae
fix(ci/collect): bad dependency fixed
bouda1 Feb 6, 2023
a656e2e
fix(ci/collect): bad dependency fixed
bouda1 Feb 6, 2023
62b0b99
fix(ci/collect): bad dependency fixed
bouda1 Feb 6, 2023
a55e181
fix(ci/package): better inputs forward
bouda1 Feb 6, 2023
22c83aa
fix(ci/dependency)
bouda1 Feb 6, 2023
2b3f272
fix(ci/robot): dependency fixed
bouda1 Feb 6, 2023
bb02923
fix(ci/robot): dependency fixed
bouda1 Feb 6, 2023
94cc8f4
fix(ci/robot): bad dependency
bouda1 Feb 6, 2023
3799a13
fix(ci/robot): a syntax error in the call of robot
bouda1 Feb 6, 2023
39ed88e
fix(ci/delivery): just on robot's success
bouda1 Feb 6, 2023
f8ec7b0
fix(ci/robot): fix a label
bouda1 Feb 6, 2023
fbccad4
run robot test directly in container
kduret Feb 6, 2023
1cbdf00
do not use env variable
kduret Feb 6, 2023
6bba638
fix registry
kduret Feb 6, 2023
0224091
fix(ci/robot): where are we
bouda1 Feb 6, 2023
0da81f0
fix(ci/robot): where are we
bouda1 Feb 6, 2023
b54d344
fix script path
kduret Feb 6, 2023
f143a72
fix path to tests dir
kduret Feb 6, 2023
ad25ed5
fix(ci): centos7 removed from develop
bouda1 Feb 6, 2023
423f2e4
fix(ci/scripts): big cleanup with el7 removed
bouda1 Feb 6, 2023
eeb6420
Merge branch 'develop' into MON-16758-robot-and-deliver
kduret Feb 6, 2023
f415d07
add concurrency
kduret Feb 6, 2023
4d5a115
refacto
kduret Feb 6, 2023
ca3b80c
reusable workflow
kduret Feb 6, 2023
c068bab
fix
kduret Feb 6, 2023
79f8340
fix
kduret Feb 6, 2023
f746b1a
fix
kduret Feb 6, 2023
14aee6c
test
kduret Feb 7, 2023
1c7af60
test
kduret Feb 7, 2023
ac2ae21
test
kduret Feb 7, 2023
c1e31df
test
kduret Feb 7, 2023
c6acb1d
test
kduret Feb 7, 2023
41b0842
test
kduret Feb 7, 2023
40883f2
test
kduret Feb 7, 2023
40046b1
refacto
kduret Feb 7, 2023
1ea907e
refacto
kduret Feb 7, 2023
c2570a1
refacto
kduret Feb 7, 2023
568472b
refacto
kduret Feb 7, 2023
32162c0
fix
kduret Feb 7, 2023
5fc683f
fix
kduret Feb 7, 2023
2675f9a
fix
kduret Feb 7, 2023
7dd1190
fix
kduret Feb 7, 2023
3c1bf1b
fix
kduret Feb 7, 2023
0f413df
fix
kduret Feb 7, 2023
8d458ac
fix
kduret Feb 7, 2023
0686e73
optim
kduret Feb 7, 2023
542b8f0
optim
kduret Feb 7, 2023
1d769a9
optim
kduret Feb 7, 2023
6506b4d
optim
kduret Feb 7, 2023
9bdcd36
optim
kduret Feb 7, 2023
41e81af
optim
kduret Feb 7, 2023
85dda2f
optim
kduret Feb 7, 2023
559e5c1
optim
kduret Feb 7, 2023
53ba811
optim
kduret Feb 7, 2023
3990219
optim
kduret Feb 7, 2023
652672e
optim
kduret Feb 7, 2023
5112b60
optim
kduret Feb 7, 2023
7ee8be6
optim
kduret Feb 7, 2023
597d38f
optim
kduret Feb 7, 2023
0cf1298
optim
kduret Feb 7, 2023
bb49061
optim
kduret Feb 7, 2023
0421287
optim
kduret Feb 7, 2023
c281399
optim
kduret Feb 7, 2023
290f81d
ninja
kduret Feb 8, 2023
ff2a08a
ninja
kduret Feb 8, 2023
14816c4
ninja
kduret Feb 8, 2023
bc1cbc5
ninja
kduret Feb 8, 2023
fe8c182
ninja
kduret Feb 8, 2023
1250c3e
ninja
kduret Feb 8, 2023
010db70
ninja
kduret Feb 8, 2023
88946f9
ninja
kduret Feb 8, 2023
f6dceed
ninja
kduret Feb 8, 2023
eb1e615
ninja
kduret Feb 8, 2023
d07296a
ninja
kduret Feb 8, 2023
c4bf4cc
ninja
kduret Feb 8, 2023
bc6c074
ninja
kduret Feb 8, 2023
4cb7faa
ninja
kduret Feb 8, 2023
039c3d3
ninja
kduret Feb 8, 2023
570019f
ninja
kduret Feb 8, 2023
e8b1250
ninja
kduret Feb 8, 2023
65db119
ninja
kduret Feb 8, 2023
ded5d24
ninja
kduret Feb 8, 2023
ffc3011
ninja
kduret Feb 8, 2023
a3c908a
ninja
kduret Feb 8, 2023
ccd2cb1
ninja
kduret Feb 8, 2023
9be68c4
ninja
kduret Feb 8, 2023
721c969
ninja
kduret Feb 8, 2023
b149742
ninja
kduret Feb 8, 2023
a5bc21e
ninja
kduret Feb 8, 2023
cabf4fa
ninja
kduret Feb 8, 2023
5594aa4
ninja
kduret Feb 8, 2023
59a7238
ninja
kduret Feb 8, 2023
2537180
ninja
kduret Feb 8, 2023
5ab9952
ninja
kduret Feb 8, 2023
75de69b
ninja
kduret Feb 8, 2023
1d273a5
ninja
kduret Feb 8, 2023
912c926
end
kduret Feb 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/get-packages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ runs:
steps:
- name: Build name for RPM
shell: bash
if: ${{ inputs.distrib == 'el7' || inputs.distrib == 'el8' }}
if: ${{ startsWith(inputs.distrib, 'el') }}
run: |
echo "build=rpmbuild-centreon-collect" >> $GITHUB_ENV
echo "extfile=rpm" >> $GITHUB_ENV
Expand Down Expand Up @@ -72,7 +72,7 @@ runs:
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')
PKG_DIR_VERSION=$(curl -s "https://yum.centreon.com/standard/23.04/${{ inputs.distrib }}/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"

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/package-sign/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ runs:
password: ${{ inputs.password }}

- run: docker run -i -e TOKEN=${{ inputs.centreon_pat }} --entrypoint /src/.github/scripts/${{ inputs.script_name }}.sh -v "$PWD:/src" centreon.jfrog.io/docker/${{ inputs.image_name }}:${{ inputs.image_version}} ${{ inputs.params }}
shell: bash
shell: bash
41 changes: 27 additions & 14 deletions .github/docker/Dockerfile.collect-alma8
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
FROM almalinux:8

RUN <<EOF

# Base dnf configuration.
RUN echo 'http_caching=none' >> /etc/yum.conf && \
echo 'assumeyes=1' >> /etc/yum.conf && \
sed -i 's/best=True/best=False/g' /etc/dnf/dnf.conf && \
dnf install -y dnf-plugins-core
RUN dnf config-manager --set-enabled powertools
echo 'http_caching=none' >> /etc/yum.conf && \
echo 'assumeyes=1' >> /etc/yum.conf && \
sed -i 's/best=True/best=False/g' /etc/dnf/dnf.conf && \
dnf install -y dnf-plugins-core
dnf config-manager --set-enabled powertools

RUN dnf install -y epel-release
dnf install -y epel-release

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 install -y cmake \
curl -LsS "https://r.mariadb.com/downloads/mariadb_repo_setup" | bash -s -- --os-type=rhel --os-version=8 --mariadb-server-version="mariadb-10.5"
dnf install -y cmake \
gcc \
gcc-c++ \
gettext \
git \
ninja-build \
MariaDB-devel \
MariaDB-shared \
MariaDB-client \
Expand All @@ -35,13 +38,23 @@ RUN dnf install -y cmake \
rrdtool-devel \
yum-utils \
perl \
rpm-build
RUN dnf update libarchive
rpm-build \
zstd

dnf update libarchive

pip3 install conan --prefix=/usr --upgrade
rm -rf ~/.conan/profiles/default

EOF

RUN pip3 install conan --prefix=/usr --upgrade
RUN rm -rf ~/.conan/profiles/default
COPY conanfile.txt .
RUN cat conanfile.txt
RUN conan install . -s compiler.cppstd=14 -s compiler.libcxx=libstdc++11 --build=missing

RUN <<EOF

cat conanfile.txt
conan install . -s compiler.cppstd=14 -s compiler.libcxx=libstdc++11 --build=missing

EOF

WORKDIR /src
4 changes: 3 additions & 1 deletion .github/docker/Dockerfile.collect-alma9
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dnf install -y cmake \
gcc-c++ \
gettext \
git \
ninja-build \
mariadb-server \
mariadb \
gnutls-devel \
Expand All @@ -32,7 +33,8 @@ dnf install -y cmake \
yum-utils \
perl \
rpm-build \
procps-ng
procps-ng \
zstd

pip3 install conan --prefix=/usr --upgrade
rm -rf ~/.conan/profiles/default
Expand Down
57 changes: 0 additions & 57 deletions .github/docker/Dockerfile.collect-centos7

This file was deleted.

42 changes: 29 additions & 13 deletions .github/docker/Dockerfile.collect-debian-bullseye
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
FROM debian:bullseye
RUN apt-get -y update && \
apt-get -y install cmake \

RUN <<EOF

apt-get -y update

apt-get -y install cmake \
curl \
gcc \
g++ \
Expand All @@ -9,7 +13,6 @@ RUN apt-get -y update && \
libmariadb3 \
librrd-dev \
libgnutls28-dev \
ninja-build \
liblua5.3-dev \
python3 \
python3-pip \
Expand All @@ -25,15 +28,28 @@ RUN apt-get -y update && \
devscripts \
fakeroot \
strace \
locales && \
rm -rf /var/lib/apt/lists/* && \
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
RUN python3 get-pip.py
RUN pip3 install conan
RUN ln -s /usr/local/bin/conan /usr/bin/conan
RUN rm -rf ~/.conan/profiles/default
locales \
zstd

apt-get clean

localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
pip3 install conan
ln -s /usr/local/bin/conan /usr/bin/conan
rm -rf ~/.conan/profiles/default

EOF

COPY conanfile.txt .
RUN cat conanfile.txt
RUN conan install . -s compiler.cppstd=14 -s compiler.libcxx=libstdc++11 --build='missing'

RUN <<EOF

cat conanfile.txt
conan install . -s compiler.cppstd=14 -s compiler.libcxx=libstdc++11 --build='missing'

EOF

WORKDIR /src
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,10 @@ if [ -d "$ROOT/build" ] ; then
fi
tar --exclude={".git","build"} -czpf $ROOT-$VERSION.tar.gz "$ROOT"
cd "$ROOT"
cp -r ci/debian debian
cp -r packaging/debian debian

sed -i "s/^centreon:version=.*$/centreon:version=$(echo $VERSION-$RELEASE)/" debian/substvars
echo "debmake begin"

debmake -f "${AUTHOR}" -e "${AUTHOR_EMAIL}" -u "$VERSION" -r "$RELEASE"
echo "version de dwz"
/usr/bin/dwz -v
echo "version de gcc"
gcc --version
echo "version de ld"
ld --version

debuild-pbuilder
cd ../
22 changes: 22 additions & 0 deletions .github/scripts/collect-rpm-package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e

if [ -z "$VERSION" -o -z "$RELEASE" -o -z "$DISTRIB" ] ; then
echo "You need to specify VERSION / RELEASE / DISTRIB variables"
exit 1
fi

if [ ! -d ~/rpmbuild/SOURCES ] ; then
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
fi

tar czf ~/rpmbuild/SOURCES/centreon-collect-$VERSION.tar.gz \
--exclude './build' \
--exclude './.git' \
--transform "s,^\.,centreon-collect-$VERSION," .

cp packaging/rpm/centreonengine_integrate_centreon_engine2centreon.sh ~/rpmbuild/SOURCES/

rpmbuild -ba packaging/rpm/centreon-collect.spec -D "VERSION $VERSION" -D "RELEASE $RELEASE"

cp -r ~/rpmbuild/RPMS/x86_64/*.rpm .
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -P ""
/usr/sbin/sshd > /dev/null 2>&1 &

echo "########################### Start MariaDB ######################################"
mariadbd --user=root > /dev/null 2>&1 &
mysql_install_db --user=root --basedir=/usr --datadir=/var/lib/mysql
mariadbd --socket=/var/lib/mysql/mysql.sock --user=root > /dev/null 2>&1 &
sleep 5

echo "########################### Init centreon database ############################"
Expand All @@ -29,37 +30,23 @@ echo "Installation..."
/usr/bin/rpm -Uvvh --force --nodeps *.rpm

echo "########################### Install Robot Framework ###########################"
cd /src/tests/
cd tests
pip3 install -U robotframework robotframework-databaselibrary pymysql python-dateutil

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
pip3 install grpcio grpcio_tools

echo "##### site-packages #####"
find / -name site-packages

echo "##### grpc #####"
find / -name grpc

echo "##### Starting tests #####"
./init-proto.sh

echo "####################### Run Centreon Collect Robot Tests #######################"
cd /src/tests/
robot --nostatusrc .

echo "########################### Generate Folder Report #############################"
mkdir reports
cp log.html output.xml report.html reports
robot $1

26 changes: 26 additions & 0 deletions .github/scripts/collect-unit-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
set -e

#Cmake
rm -rf /src/build
mkdir /src/build
cd /src/build/

conan install .. -s compiler.cppstd=14 -s compiler.libcxx=libstdc++11 --build=missing
if [ $(cat /etc/issue | awk '{print $1}') = "Debian" ] ; then
CXXFLAGS="-Wall -Wextra" cmake -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DWITH_CENTREON_CLIB_INCLUDE_DIR=../clib/inc/ -DWITH_CENTREON_CLIB_LIBRARIES=centreon-clib/libcentreon_clib.so -DCMAKE_BUILD_TYPE=Debug -DWITH_PREFIX=/usr -DWITH_PREFIX_BIN=/usr/sbin -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_PREFIX_MODULES=/usr/share/centreon/lib/centreon-broker -DWITH_PREFIX_CONF_BROKER=/etc/centreon-broker -DWITH_PREFIX_LIB_BROKER=/usr/lib64/nagios -DWITH_PREFIX_CONF_ENGINE=/etc/centreon-engine -DWITH_PREFIX_LIB_ENGINE=/usr/lib64/centreon-engine -DWITH_PREFIX_LIB_CLIB=/usr/lib64/ -DWITH_RW_DIR=/var/lib/centreon-engine/rw -DWITH_VAR_DIR=/var/log/centreon-engine -DWITH_MODULE_SIMU=On ..
else
CXXFLAGS="-Wall -Wextra" cmake3 -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DWITH_CENTREON_CLIB_INCLUDE_DIR=../clib/inc/ -DWITH_CENTREON_CLIB_LIBRARIES=centreon-clib/libcentreon_clib.so -DCMAKE_BUILD_TYPE=Debug -DWITH_PREFIX=/usr -DWITH_PREFIX_BIN=/usr/sbin -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_PREFIX_MODULES=/usr/share/centreon/lib/centreon-broker -DWITH_PREFIX_CONF_BROKER=/etc/centreon-broker -DWITH_PREFIX_LIB_BROKER=/usr/lib64/nagios -DWITH_PREFIX_CONF_ENGINE=/etc/centreon-engine -DWITH_PREFIX_LIB_ENGINE=/usr/lib64/centreon-engine -DWITH_PREFIX_LIB_CLIB=/usr/lib64/ -DWITH_RW_DIR=/var/lib/centreon-engine/rw -DWITH_VAR_DIR=/var/log/centreon-engine -DWITH_MODULE_SIMU=On ..
fi

#Build
ninja -j 8
ninja -j 8 install

#Test

tests/ut_broker --gtest_output=xml:ut_broker.xml
tests/ut_engine --gtest_output=xml:ut_engine.xml
tests/ut_clib --gtest_output=xml:ut_clib.xml
tests/ut_connector --gtest_output=xml:ut_connector.xml
echo "---------------------------------------------------------- end of ut tests ------------------------------------------------"
Loading