Skip to content

Commit 32dfd3f

Browse files
authored
Merge pull request #228 from postgrespro/fix-msql-ci
fix(ci): fixed mysql version
2 parents b74efef + 219ebea commit 32dfd3f

2 files changed

Lines changed: 27 additions & 8 deletions

File tree

github-actions-tests/tools/zabbix_cli.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,9 @@ ZBX_VERSION_MAJOR=${ZBX_VERSION_ARRAY[0]}
4646
ZBX_VERSION_MINOR=${ZBX_VERSION_ARRAY[1]}
4747

4848
OLD_ZABBIX=" "
49-
if ((ZBX_VERSION_MAJOR <= 4))
49+
if ((ZBX_VERSION_MAJOR < 4))
5050
then
51-
if ((ZBX_VERSION_MINOR <= 2))
52-
then
53-
OLD_ZABBIX=" --old-zabbix "
54-
fi
51+
OLD_ZABBIX=" --old-zabbix "
5552
fi
5653

5754
echo && echo "------> mamonsu zabbix version"

github-actions-tests/zbx_install.sh

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,36 @@ esac
1717
done
1818

1919
echo "================================================================================================================="
20-
sudo mkdir 775 -p /docker/zabbix-docker/
20+
sudo mkdir -m 775 -p /docker/zabbix-docker/
2121
cd /docker/zabbix-docker/ 2>&1 1>/dev/null
2222
sudo wget https://github.com/zabbix/zabbix-docker/archive/refs/tags/${ZBX_VERSION}.zip
2323
sudo unzip ${ZBX_VERSION}.zip
2424
cd zabbix-docker-${ZBX_VERSION} 2>&1 1>/dev/null
2525
echo "---> Setting up docker with Zabbix ${ZBX_VERSION}..."
2626
# docker-compose dirty hack: it uses only file named 'docker-compose.yml'
2727
yes | sudo cp docker-compose_v3_alpine_mysql_latest.yaml docker-compose.yml
28+
29+
# Pin MySQL to 8.0.33 to avoid mysql_native_password deprecation in 8.0.34+
30+
sudo sed -i 's/mysql:8\.0/mysql:8.0.33/g' docker-compose.yml
31+
32+
# Replace MYSQL_ROOT_PASSWORD_FILE with plain MYSQL_ROOT_PASSWORD to avoid:
33+
# - "Secret file not found" in Zabbix 6.0+ web container (secret not mounted)
34+
# - "Both X and X_FILE are set" in MySQL 8.0.46+ entrypoint
35+
sudo sed -i 's/^\(MYSQL_ROOT_PASSWORD_FILE=.*\)/# \1/' env_vars/.env_db_mysql
36+
sudo sed -i 's/^# MYSQL_ROOT_PASSWORD=$/MYSQL_ROOT_PASSWORD=root_pwd/' env_vars/.env_db_mysql
37+
sudo sed -i 's/MYSQL_ROOT_PASSWORD_FILE=\/run\/secrets\/MYSQL_ROOT_PASSWORD/MYSQL_ROOT_PASSWORD=root_pwd/' compose_databases.yaml 2>/dev/null
38+
2839
docker-compose -f ./docker-compose.yml up -d
29-
# wait for full set up
30-
sleep 1m
40+
41+
echo "---> Waiting for Zabbix ..."
42+
WAITED=0
43+
until curl -sf http://localhost:80/ > /dev/null 2>&1; do
44+
sleep 5
45+
WAITED=$((WAITED + 5))
46+
if [ $WAITED -ge 300 ]; then
47+
echo "ERROR: Zabbix not ready after 300s"
48+
docker-compose -f ./docker-compose.yml ps
49+
docker-compose -f ./docker-compose.yml logs --tail=20
50+
exit 1
51+
fi
52+
done

0 commit comments

Comments
 (0)