Merge branch 'ent-4697-cicd-pandorafms' into 'develop'
Resolved deprecated options rpm spec See merge request artica/pandorafms!2989
This commit is contained in:
commit
ba7936f084
|
@ -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
|
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||||
if [ $? = 1 ]
|
if [ $? = 1 ]
|
||||||
then
|
then
|
||||||
echo "No found \"dpkg-deb\" aplication, please install."
|
if [ "$DPKG_DEB" == "" ]; then
|
||||||
exit 1
|
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
|
else
|
||||||
echo "Found \"dpkg-debs\"."
|
echo "Found \"dpkg-debs\"."
|
||||||
fi
|
fi
|
||||||
|
@ -122,8 +128,12 @@ do
|
||||||
done
|
done
|
||||||
echo "END"
|
echo "END"
|
||||||
|
|
||||||
echo "Make the package \"Pandorafms console\"."
|
echo "Make the package \"Pandorafms agent\"."
|
||||||
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.agent_unix_$pandora_version.deb
|
mv temp_package.deb pandorafms.agent_unix_$pandora_version.deb
|
||||||
|
|
||||||
echo "Delete the \"temp_package\" temp dir for job."
|
echo "Delete the \"temp_package\" temp dir for job."
|
||||||
|
|
|
@ -18,7 +18,8 @@ Packager: Sancho Lerena <slerena@artica.es>
|
||||||
Prefix: /usr/share
|
Prefix: /usr/share
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
|
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
|
||||||
BuildArch: noarch
|
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)
|
Requires: coreutils unzip perl perl(Sys::Syslog) perl(IO::Compress::Zip) perl(YAML::Tiny)
|
||||||
AutoReq: 0
|
AutoReq: 0
|
||||||
Provides: %{name}-%{version}
|
Provides: %{name}-%{version}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -44,8 +44,15 @@ then
|
||||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||||
if [ $? = 1 ]
|
if [ $? = 1 ]
|
||||||
then
|
then
|
||||||
echo "No found \"dpkg-deb\" aplication, please install."
|
if [ "$DPKG_DEB" == "" ]; then
|
||||||
exit 1
|
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
|
else
|
||||||
echo "Found \"dpkg-debs\"."
|
echo "Found \"dpkg-debs\"."
|
||||||
fi
|
fi
|
||||||
|
@ -70,15 +77,15 @@ then
|
||||||
else
|
else
|
||||||
echo "Found \"fakeroot\"."
|
echo "Found \"fakeroot\"."
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
whereis dpkg-buildpackage | cut -d":" -f2 | grep dpkg-buildpackage > /dev/null
|
whereis dpkg-buildpackage | cut -d":" -f2 | grep dpkg-buildpackage > /dev/null
|
||||||
if [ $? = 1 ]
|
if [ $? = 1 ]
|
||||||
then
|
then
|
||||||
echo " \"dpkg-buildpackage\" aplication not found, please install."
|
echo " \"dpkg-buildpackage\" aplication not found, please install."
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "Found \"dpkg-buildpackage\"."
|
echo "Found \"dpkg-buildpackage\"."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
@ -141,7 +148,11 @@ then
|
||||||
echo "END"
|
echo "END"
|
||||||
|
|
||||||
echo "Make the package \"Pandorafms console\"."
|
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
|
mv temp_package.deb pandorafms.console_$pandora_version.deb
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -919,7 +919,7 @@ function servers_get_info($id_server=-1)
|
||||||
|
|
||||||
// Remote servers LAG Calculation (server_type != 0).
|
// Remote servers LAG Calculation (server_type != 0).
|
||||||
if ($server['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(
|
$result = db_get_row_sql(
|
||||||
'SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag,
|
'SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag,
|
||||||
AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS "lag"
|
AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS "lag"
|
||||||
|
@ -936,7 +936,7 @@ function servers_get_info($id_server=-1)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Local/Dataserver server LAG calculation.
|
// 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(
|
$result = db_get_row_sql(
|
||||||
'SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag,
|
'SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag,
|
||||||
AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS "lag"
|
AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS "lag"
|
||||||
|
|
|
@ -129,7 +129,7 @@
|
||||||
<div style='height: 10px'>
|
<div style='height: 10px'>
|
||||||
<?php
|
<?php
|
||||||
$version = '7.0NG.742';
|
$version = '7.0NG.742';
|
||||||
$build = '200127';
|
$build = '200103';
|
||||||
$banner = "v$version Build $build";
|
$banner = "v$version Build $build";
|
||||||
|
|
||||||
error_reporting(0);
|
error_reporting(0);
|
||||||
|
@ -965,12 +965,9 @@ function install_step4()
|
||||||
|
|
||||||
$step5 = mysqli_query(
|
$step5 = mysqli_query(
|
||||||
$connection,
|
$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');
|
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>");
|
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>");
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,22 @@ mkdir temp_package
|
||||||
|
|
||||||
if [ $package_pandora -eq 1 ]
|
if [ $package_pandora -eq 1 ]
|
||||||
then
|
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/bin/
|
||||||
mkdir -p temp_package/usr/sbin/
|
mkdir -p temp_package/usr/sbin/
|
||||||
mkdir -p temp_package/etc/init.d/
|
mkdir -p temp_package/etc/init.d/
|
||||||
|
@ -164,8 +180,15 @@ then
|
||||||
echo "END"
|
echo "END"
|
||||||
|
|
||||||
echo "Make the package \"Pandorafms server\"."
|
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
|
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
|
chmod 777 pandorafms.server_$pandora_version.deb
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,7 @@ fi
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root)
|
%defattr(750,root,root)
|
||||||
%doc AUTHORS COPYING README
|
%doc AUTHORS COPYING README
|
||||||
%{_sysconfdir}/rc.d/init.d/pandora_server
|
%{_sysconfdir}/rc.d/init.d/pandora_server
|
||||||
%{_sysconfdir}/rc.d/init.d/tentacle_serverd
|
%{_sysconfdir}/rc.d/init.d/tentacle_serverd
|
||||||
|
@ -174,10 +174,11 @@ exit 0
|
||||||
%{_mandir}/man1/pandora_server.1.gz
|
%{_mandir}/man1/pandora_server.1.gz
|
||||||
%{_mandir}/man1/tentacle_server.1.gz
|
%{_mandir}/man1/tentacle_server.1.gz
|
||||||
|
|
||||||
%defattr(-,pandora,root)
|
%defattr(750,pandora,root)
|
||||||
%{_bindir}/pandora_exec
|
%{_bindir}/pandora_exec
|
||||||
%{_bindir}/pandora_server
|
%{_bindir}/pandora_server
|
||||||
%{_bindir}/tentacle_server
|
%{_bindir}/tentacle_server
|
||||||
|
|
||||||
%dir %{_sysconfdir}/pandora
|
%dir %{_sysconfdir}/pandora
|
||||||
%dir %{_localstatedir}/spool/pandora
|
%dir %{_localstatedir}/spool/pandora
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,8 @@ Packager: Sancho Lerena <slerena@artica.es>
|
||||||
Prefix: /usr/share
|
Prefix: /usr/share
|
||||||
BuildRoot: %{_tmppath}/%{name}-buildroot
|
BuildRoot: %{_tmppath}/%{name}-buildroot
|
||||||
BuildArch: noarch
|
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
|
AutoReq: 0
|
||||||
Provides: %{name}-%{version}
|
Provides: %{name}-%{version}
|
||||||
Requires: perl-DBI perl-DBD-mysql perl-libwww-perl
|
Requires: perl-DBI perl-DBD-mysql perl-libwww-perl
|
||||||
|
|
Loading…
Reference in New Issue