From b8acaaad24307747fe9fef207eea36e36f70068f Mon Sep 17 00:00:00 2001 From: root Date: Sat, 22 Feb 2020 21:29:53 +0100 Subject: [PATCH] Upgrade of upgrade script --- scripts/upgrade | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index fcb09da..dc1ef09 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,6 +7,9 @@ #================================================= source _common.sh +source ynh_add_extra_apt_repos__3 +source ynh_install_php__3 +source ynh_composer source /usr/share/yunohost/helpers #================================================= @@ -92,14 +95,31 @@ mkdir -p "$final_path/storage/upload/" mkdir -p "$final_path/storage/export/" cp -a "$final_path/storage/upload/" "$tmpdir/storage/upload/" cp -a "$final_path/storage/export/" "$tmpdir/storage/export/" +rm -Rf "$final_path" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" +ynh_install_composer --phpversion="$phpversion" +cd $final_path && php$phpversion artisan migrate:refresh --seed +cd $final_path && php$phpversion artisan firefly-iii:upgrade-database +cd $final_path && php$phpversion artisan passport:install + rm -rf "$final_path/bootstrap/cache/*" + +cd $final_path && php$phpversion artisan cache:clear +cd $final_path && php$phpversion artisan migrate --seed +cd $final_path && php$phpversion artisan firefly-iii:upgrade-database +cd $final_path && php$phpversion artisan passport:install +cd $final_path && php$phpversion artisan cache:clear + cp -a "$tmpdir/storage/upload/" "$final_path/storage/upload/" cp -a "$tmpdir/storage/export/" "$final_path/storage/export/" +# Set right permissions +chown -R $app:$app $final_path +chmod -R 775 ${final_path}/storage + #remove tmp dir sudo rm -Rf "$tmpdir"