[PHP-FPM] Check if tz data import is necessary

master
andryyy 2019-11-11 23:19:47 +01:00
parent eadf051d70
commit 322dc169e6
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
2 changed files with 7 additions and 4 deletions

View File

@ -76,9 +76,12 @@ if [ ${SQL_CHANGED} -eq 1 ]; then
fi
# Check mysql tz import
SQL_FULL_TZINFO_IMPORT_RETURN=$(curl --silent --insecure -XPOST https://dockerapi/containers/${CONTAINER_ID}/exec -d '{"cmd":"system", "task":"mysql_tzinfo_to_sql"}' --silent -H 'Content-type: application/json')
echo "MySQL mysql_tzinfo_to_sql - debug output:"
echo ${SQL_FULL_TZINFO_IMPORT_RETURN}
TZ_CHECK=$(mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "SELECT CONVERT_TZ('2019-11-02 23:33:00','Europe/Berlin','UTC') AS time;" -BN 2> /dev/null)
if [[ -z ${TZ_CHECK} ]]; then
SQL_FULL_TZINFO_IMPORT_RETURN=$(curl --silent --insecure -XPOST https://dockerapi/containers/${CONTAINER_ID}/exec -d '{"cmd":"system", "task":"mysql_tzinfo_to_sql"}' --silent -H 'Content-type: application/json')
echo "MySQL mysql_tzinfo_to_sql - debug output:"
echo ${SQL_FULL_TZINFO_IMPORT_RETURN}
fi
# Trigger db init
echo "Running DB init..."

View File

@ -97,7 +97,7 @@ services:
- rspamd
php-fpm-mailcow:
image: mailcow/phpfpm:1.53
image: mailcow/phpfpm:1.54
build: ./data/Dockerfiles/phpfpm
command: "php-fpm -d date.timezone=${TZ} -d expose_php=0"
depends_on: