From 80af981711d17c2f937de1828b3c4e624b6ad9ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 11 Mar 2019 15:28:09 +0100 Subject: [PATCH] upgrade: call convert-timezone script to update timezones https://github.com/kevinpapst/kimai2/pull/372 --- scripts/upgrade | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 3fd173f..24e608c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -77,6 +77,9 @@ ynh_install_php7 # Download, check integrity, uncompress and patch the source from app.src and do required installation for update +# version before upgrade +old_ver=`sudo yunohost app info $app --output-as plain | ynh_get_plain_key version` + #version check for 0.3 version=`cd /var/www/$app && bin/console kimai:version --short 2> /dev/null || sed -n 's/^future-release=//p' .github_changelog_generator` @@ -152,6 +155,13 @@ init_composer $final_path cd $final_path && sudo /usr/bin/php7.2 bin/console cache:clear --env=prod cd $final_path && sudo /usr/bin/php7.2 bin/console cache:warmup --env=prod cd $final_path && sudo /usr/bin/php7.2 bin/console doctrine:migrations:migrate -n + +# call convert-timezone script when upgrading from < 0.8 verions +# fixes timezone issue: https://github.com/kevinpapst/kimai2/pull/372 +if `dpkg --compare-versions $old_ver "lt" "0.8"` +then + cd $final_path && sudo /usr/bin/php7.2 bin/console kimai:convert-timezone -n +fi ) #================================================= # NGINX CONFIGURATION