aboutsummaryrefslogtreecommitdiff
path: root/scripts/upgrade
diff options
context:
space:
mode:
authorThomas <51749973+Thovi98@users.noreply.github.com>2025-08-24 22:11:54 +0200
committerGitHub <noreply@github.com>2025-08-24 22:11:54 +0200
commit9b7308681eed5b930c60dd882d6588a6fc28af37 (patch)
treed2ac88904c43c34b0829c86dce68e96fd6fd3e1b /scripts/upgrade
parent9a9079042ee2923c1a5dfa59dcbe17ee3e03617d (diff)
parent8fb1c6c7818430e8ac49f3ae589c6575614f5e4b (diff)
downloadmastodon_ynh-9b7308681eed5b930c60dd882d6588a6fc28af37.tar.gz
mastodon_ynh-9b7308681eed5b930c60dd882d6588a6fc28af37.tar.bz2
mastodon_ynh-9b7308681eed5b930c60dd882d6588a6fc28af37.zip
Merge branch 'testing' into ci-auto-update-4.4.3
Diffstat (limited to 'scripts/upgrade')
-rw-r--r--scripts/upgrade15
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/upgrade b/scripts/upgrade
index d44d200..aef5d67 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -87,6 +87,8 @@ 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 --keep="public/system .env.production"
+# Download redis migration script
+ynh_setup_source --source_id=redis_migration --dest_dir="$install_dir/live"
chmod -R 775 "$install_dir"
chmod o-rwx "$install_dir"
@@ -98,7 +100,6 @@ chown -R $app:www-data "$install_dir"
ynh_script_progression "Building assets..."
pushd "$install_dir/live"
-
gem update --system
gem install bundler --no-document
ynh_hide_warnings ynh_exec_as_app $ld_preload bin/bundle config deployment 'true'
@@ -168,9 +169,19 @@ ynh_config_add --template=".env.production.sample" --destination="$config"
ynh_script_progression "Applying migrations..."
pushd "$install_dir/live"
-
ynh_hide_warnings ynh_exec_as_app RAILS_ENV=production $ld_preload bin/bundle exec rails db:migrate --quiet
ynh_hide_warnings ynh_exec_as_app RAILS_ENV=production $ld_preload bin/bundle exec rails assets:precompile --quiet
+
+ # Apply redis namespace migration (https://github.com/mastodon/redis_namespace_migration)
+ ynh_hide_warings ynh_exec_as_app RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 $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
#=================================================