Merge branch 'ent-4697-cicd-pandorafms' into 'develop'

Resolved deprecated options rpm spec

See merge request artica/pandorafms!2989
This commit is contained in:
Daniel Rodriguez 2020-01-27 12:55:12 +01:00
commit ba7936f084
9 changed files with 3504 additions and 28 deletions

View File

@ -20,8 +20,14 @@ echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
if [ $? = 1 ]
then
echo "No found \"dpkg-deb\" aplication, please install."
exit 1
if [ "$DPKG_DEB" == "" ]; then
echo "No found \"dpkg-deb\" aplication, please install."
exit 1
fi
echo ">> Using dockerized version of dpkg-deb: "
echo " $DPKG_DEB"
USE_DOCKER_APP=1
else
echo "Found \"dpkg-debs\"."
fi
@ -122,8 +128,12 @@ do
done
echo "END"
echo "Make the package \"Pandorafms console\"."
dpkg-deb --build temp_package
echo "Make the package \"Pandorafms agent\"."
if [ "$USE_DOCKER_APP" == "1" ]; then
eval $DPKG_DEB --build temp_package
else
dpkg-deb --build temp_package
fi
mv temp_package.deb pandorafms.agent_unix_$pandora_version.deb
echo "Delete the \"temp_package\" temp dir for job."

View File

@ -18,7 +18,8 @@ Packager: Sancho Lerena <slerena@artica.es>
Prefix: /usr/share
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
BuildArch: noarch
PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd
#PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd
Requires(pre,preun):/usr/bin/sed /usr/bin/grep /usr/sbin/useradd
Requires: coreutils unzip perl perl(Sys::Syslog) perl(IO::Compress::Zip) perl(YAML::Tiny)
AutoReq: 0
Provides: %{name}-%{version}

File diff suppressed because it is too large Load Diff

View File

@ -44,8 +44,15 @@ then
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
if [ $? = 1 ]
then
echo "No found \"dpkg-deb\" aplication, please install."
exit 1
if [ "$DPKG_DEB" == "" ]; then
echo "No found \"dpkg-deb\" aplication, please install."
exit 1
fi
echo ">> Using dockerized version of dpkg-deb: "
echo " $DPKG_DEB"
# Use dockerized app.
USE_DOCKER_APP=1
else
echo "Found \"dpkg-debs\"."
fi
@ -70,15 +77,15 @@ then
else
echo "Found \"fakeroot\"."
fi
fi
whereis dpkg-buildpackage | cut -d":" -f2 | grep dpkg-buildpackage > /dev/null
if [ $? = 1 ]
then
echo " \"dpkg-buildpackage\" aplication not found, please install."
exit 1
else
echo "Found \"dpkg-buildpackage\"."
whereis dpkg-buildpackage | cut -d":" -f2 | grep dpkg-buildpackage > /dev/null
if [ $? = 1 ]
then
echo " \"dpkg-buildpackage\" aplication not found, please install."
exit 1
else
echo "Found \"dpkg-buildpackage\"."
fi
fi
cd ..
@ -141,7 +148,11 @@ then
echo "END"
echo "Make the package \"Pandorafms console\"."
dpkg-deb --build temp_package
if [ "$USE_DOCKER_APP" == "1" ]; then
eval $DPKG_DEB --build temp_package
else
dpkg-deb --build temp_package
fi
mv temp_package.deb pandorafms.console_$pandora_version.deb
fi

View File

@ -919,7 +919,7 @@ function servers_get_info($id_server=-1)
// Remote servers LAG Calculation (server_type != 0).
if ($server['server_type'] != 0) {
// MySQL 8.0 has function lag(). So, lag must be enclosed in quotations.
// MySQL 8.0 has function lag(). So, lag must be enclosed in quotations.
$result = db_get_row_sql(
'SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag,
AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS "lag"
@ -936,7 +936,7 @@ function servers_get_info($id_server=-1)
);
} else {
// Local/Dataserver server LAG calculation.
// MySQL 8.0 has function lag(). So, lag must be enclosed in quotations.
// MySQL 8.0 has function lag(). So, lag must be enclosed in quotations.
$result = db_get_row_sql(
'SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag,
AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS "lag"

View File

@ -129,7 +129,7 @@
<div style='height: 10px'>
<?php
$version = '7.0NG.742';
$build = '200127';
$build = '200103';
$banner = "v$version Build $build";
error_reporting(0);
@ -965,12 +965,9 @@ function install_step4()
$step5 = mysqli_query(
$connection,
"CREATE USER pandora@$host IDENTIFIED BY '".$random_password."'"
"GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host
IDENTIFIED BY '".$random_password."'"
);
$step5 |= mysqli_query(
$connection,
"GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host"
);
mysqli_query($connection, 'FLUSH PRIVILEGES');
check_generic($step5, "Established privileges for user pandora. A new random password has been generated: <b>$random_password</b><div class='warn'>Please write it down, you will need to setup your Pandora FMS server, editing the </i>/etc/pandora/pandora_server.conf</i> file</div>");

View File

@ -64,6 +64,22 @@ mkdir temp_package
if [ $package_pandora -eq 1 ]
then
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
if [ $? = 1 ]
then
if [ "$DPKG_DEB" == "" ]; then
echo "No found \"dpkg-deb\" aplication, please install."
exit 1
fi
echo ">> Using dockerized version of dpkg-deb: "
echo " $DPKG_DEB"
# Use dockerized app.
USE_DOCKER_APP=1
else
echo "Found \"dpkg-debs\"."
fi
mkdir -p temp_package/usr/bin/
mkdir -p temp_package/usr/sbin/
mkdir -p temp_package/etc/init.d/
@ -164,8 +180,15 @@ then
echo "END"
echo "Make the package \"Pandorafms server\"."
dpkg-deb --build temp_package
if [ "$USE_DOCKER_APP" == "1" ]; then
eval $DPKG_DEB --build temp_package
else
dpkg-deb --build temp_package
fi
mv temp_package.deb pandorafms.server_$pandora_version.deb
echo "generated: pandorafms.server_$pandora_version.deb"
pwd
ls -lah pandorafms.server_$pandora_version.deb
chmod 777 pandorafms.server_$pandora_version.deb
fi

View File

@ -159,7 +159,7 @@ fi
exit 0
%files
%defattr(-,root,root)
%defattr(750,root,root)
%doc AUTHORS COPYING README
%{_sysconfdir}/rc.d/init.d/pandora_server
%{_sysconfdir}/rc.d/init.d/tentacle_serverd
@ -174,10 +174,11 @@ exit 0
%{_mandir}/man1/pandora_server.1.gz
%{_mandir}/man1/tentacle_server.1.gz
%defattr(-,pandora,root)
%defattr(750,pandora,root)
%{_bindir}/pandora_exec
%{_bindir}/pandora_server
%{_bindir}/tentacle_server
%dir %{_sysconfdir}/pandora
%dir %{_localstatedir}/spool/pandora

View File

@ -18,7 +18,8 @@ Packager: Sancho Lerena <slerena@artica.es>
Prefix: /usr/share
BuildRoot: %{_tmppath}/%{name}-buildroot
BuildArch: noarch
PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd
# PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd
Requires(pre,preun):/usr/bin/sed /usr/bin/grep /usr/sbin/useradd
AutoReq: 0
Provides: %{name}-%{version}
Requires: perl-DBI perl-DBD-mysql perl-libwww-perl