From 66959014e9b5981410ac638926c214e866bfb2ef Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 30 Dec 2024 21:23:19 +0100 Subject: Revert "Fix upgrade" This reverts commit e071d0c0df548925a54385c809d52f916bbe74e2. --- scripts/upgrade | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/upgrade b/scripts/upgrade index 531c766..10e37c9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -97,12 +97,18 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression "Upgrading source files..." -# Download, check integrity, uncompress and patch the source from manifest.toml -ynh_setup_source --dest_dir="$install_dir/live" --full_replace=1 --keep="public/system .env.production" +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_script_progression --message="Upgrading source files..." --weight=1 -chown -R $app:www-data "$install_dir" + # Download Mastodon + ynh_setup_source --dest_dir="$install_dir/live" --keep="public/system/" + + chmod 750 "$install_dir" + chmod -R o-rwx "$install_dir" + chown -R $app:www-data "$install_dir" +fi #================================================= # BUILD ASSETS @@ -187,6 +193,7 @@ ynh_script_progression --message="Applying migrations..." --weight=1 pushd "$install_dir/live" ynh_use_ruby ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails db:migrate --quiet + ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:clean --quiet ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:precompile --quiet popd -- cgit v1.2.3-70-g09d2