aboutsummaryrefslogtreecommitdiff
path: root/scripts/upgrade
diff options
context:
space:
mode:
authorTagada <36127788+Tagadda@users.noreply.github.com>2025-08-24 16:35:26 +0200
committerGitHub <noreply@github.com>2025-08-24 16:35:26 +0200
commitd7490e1860fbfb9a2f05bce4f80f74d7dbe51d59 (patch)
tree9e7a683bf305052f5b19c45b3793878abbc7e223 /scripts/upgrade
parent5bcecf75ba756b26027b740a0ae897326f8a5b50 (diff)
parent6f3d2987174de20f1ca0847745013f85363ae324 (diff)
downloadmastodon_ynh-d7490e1860fbfb9a2f05bce4f80f74d7dbe51d59.tar.gz
mastodon_ynh-d7490e1860fbfb9a2f05bce4f80f74d7dbe51d59.tar.bz2
mastodon_ynh-d7490e1860fbfb9a2f05bce4f80f74d7dbe51d59.zip
Merge pull request #507 from YunoHost-Apps/ci-auto-update-4.4.3
Upgrade to v4.4.3
Diffstat (limited to 'scripts/upgrade')
-rw-r--r--scripts/upgrade15
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/upgrade b/scripts/upgrade
index f7a3573..746d009 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -104,6 +104,8 @@ then
# 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"
+ # Download redis migration script
+ ynh_setup_source --source_id=redis_migration --dest_dir="$install_dir/live"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
@@ -122,7 +124,7 @@ pushd "$install_dir/live"
ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle config deployment 'true'
ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle config without 'development test'
ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle config set force_ruby_platform true --quiet
- ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle install -j$(getconf _NPROCESSORS_ONLN)
+ ynh_exec_warn_less ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle install -j$(getconf _NPROCESSORS_ONLN)
ynh_use_nodejs
env $ynh_node_load_PATH corepack enable
echo Y | ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn workspaces focus --production
@@ -194,6 +196,17 @@ 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:precompile --quiet
+
+ # Apply redis namespace migration (https://github.com/mastodon/redis_namespace_migration)
+ ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/rails runner rename.rb
+ redis_namespace="$(ynh_app_setting_get --app=$app --key=redis_namespace)"
+ if [ $redis_namespace ]; then
+ if [ ynh_app_setting_get --app=$app --key=es_enabled == "true" ] && [ ynh_app_setting_get --app=$app --key=es_prefix == "" ]; then
+ ynh_app_setting_set --app=$app --key=es_prefix --value=$redis_namespace
+ else
+ ynh_app_setting_delete --app=$app --key=redis_namespace
+ fi
+ fi
popd
#=================================================