Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/mamonsu-tests-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
MAMONSU_PATH: '/home/runner/work/mamonsu/mamonsu/'
strategy:
matrix:
docker_os: ['centos:7', 'centos:8']
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Centos 7 tries to check PostgreSQL 12 package and fails, so removed for now.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, I guess as a temporary change just for the sake of this PR we can merge it. I'm going to add gh actions fix soon

docker_os: ['centos:8']
zabbix_version: ['6.2.9']
pg_version: ['12', '13', '14', '15']
include:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mamonsu-tests-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
MAMONSU_PATH: '/home/runner/work/mamonsu/mamonsu/'
strategy:
matrix:
docker_os: ['ubuntu:20.04', 'centos:7', 'centos:8']
docker_os: ['ubuntu:20.04', '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:
Expand Down
8 changes: 7 additions & 1 deletion github-actions-tests/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,14 @@ elif [ "${OS%:*}" = "ubuntu" ]; then
if [[ "${OS:7}" == "20.04" ]]; then
REPO_BASE_URL="http://apt-archive.postgresql.org/pub/repos/apt"
fi

sed -i 's|http://archive.ubuntu.com|http://azure.archive.ubuntu.com|g' /etc/apt/sources.list.d/ubuntu.sources 2>/dev/null || \
sed -i 's|http://archive.ubuntu.com|http://azure.archive.ubuntu.com|g' /etc/apt/sources.list
sed -i 's|http://security.ubuntu.com|http://azure.archive.ubuntu.com|g' /etc/apt/sources.list.d/ubuntu.sources 2>/dev/null || \
sed -i 's|http://security.ubuntu.com|http://azure.archive.ubuntu.com|g' /etc/apt/sources.list

# install and set up components missing in docker image (sudo, wget, bc, unzip, lsb-release, gnupg, tzdata)
apt-get clean && apt-get update && apt-get install -y sudo
rm -rf /var/lib/apt/lists/* && apt-get update && apt-get install -y sudo
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got some problem with cache here, so changed mirrors and removed cached packages.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably apt-get clean all would suffice but this will do too

PACKAGE_MANAGER_INSTALL="sudo apt-get -y install"
PACKAGE_MANAGER_REMOVE="sudo apt-get -y remove"
eval "${PACKAGE_MANAGER_INSTALL} wget"
Expand Down
14 changes: 10 additions & 4 deletions mamonsu/tools/bootstrap/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,13 @@
BEGIN
CREATE EXTENSION IF NOT EXISTS pgpro_stats WITH SCHEMA mamonsu;

WITH tb_type AS (SELECT exists(SELECT * FROM pg_proc WHERE proname = 'pgpro_version'))
WITH tb_type AS
(SELECT
EXISTS (SELECT 1 FROM pg_settings WHERE name = 'pgpro_version') AS has_guc,
EXISTS (SELECT 1 FROM pg_proc WHERE proname = 'pgpro_version' AND pronamespace = 'pg_catalog'::regnamespace) AS has_func)
SELECT
CASE
WHEN exists = false THEN 'vanilla' ELSE 'pro'
WHEN (has_guc OR has_func) THEN 'pro' ELSE 'vanilla'
END INTO pg_type
FROM tb_type;

Expand Down Expand Up @@ -417,10 +420,13 @@
BEGIN
CREATE EXTENSION IF NOT EXISTS pgpro_stats WITH SCHEMA mamonsu;

WITH tb_type AS (SELECT exists(SELECT * FROM pg_proc WHERE proname = 'pgpro_version'))
WITH tb_type AS
(SELECT
EXISTS (SELECT 1 FROM pg_settings WHERE name = 'pgpro_version') AS has_guc,
EXISTS (SELECT 1 FROM pg_proc WHERE proname = 'pgpro_version' AND pronamespace = 'pg_catalog'::regnamespace) AS has_func)
SELECT
CASE
WHEN exists = false THEN 'vanilla' ELSE 'pro'
WHEN (has_guc OR has_func) THEN 'pro' ELSE 'vanilla'
END INTO pg_type
FROM tb_type;

Expand Down