From 7fcc02e9a00a93a63861e77aac1df26b3244295f Mon Sep 17 00:00:00 2001 From: Alison Date: Thu, 15 Feb 2024 09:46:11 +0100 Subject: [PATCH] Upgrade dependencies --- scripts/_common.sh | 4 ++-- scripts/install | 4 ++-- scripts/restore | 10 ++++++++-- scripts/upgrade | 4 ++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 8a6641d..f39b044 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,9 +9,9 @@ pkg_dependencies="imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file git MEMORY_NEEDED="2560" -RUBY_VERSION="3.2.2" +RUBY_VERSION="3.2.3" -NODEJS_VERSION="16" +NODEJS_VERSION="20" # Workaround for Mastodon on Bullseye # See https://github.com/mastodon/mastodon/issues/15751#issuecomment-873594463 diff --git a/scripts/install b/scripts/install index b56b309..a31966d 100644 --- a/scripts/install +++ b/scripts/install @@ -97,7 +97,6 @@ ynh_script_progression --message="Installing dependencies..." --weight=10 ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$NODEJS_VERSION -ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" ynh_exec_warn_less ynh_install_ruby --ruby_version=$RUBY_VERSION #================================================= @@ -228,7 +227,8 @@ pushd "$final_path/live" 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 install -j$(getconf _NPROCESSORS_ONLN) ynh_use_nodejs - ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install --pure-lockfile + corepack enable + yarn install echo "SAFETY_ASSURED=1">> $config ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails db:setup --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 diff --git a/scripts/restore b/scripts/restore index 766d553..81931c2 100644 --- a/scripts/restore +++ b/scripts/restore @@ -80,7 +80,6 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=10 # Define and install dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$NODEJS_VERSION -ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" ynh_install_ruby --ruby_version=$RUBY_VERSION #================================================= @@ -110,7 +109,7 @@ ynh_script_progression --message="Adding $swap_needed Mo to swap..." --weight=1 ynh_add_swap --size=$swap_needed #================================================= -# INSTALLING RUBY AND BUNDLER +# INSTALLING RUBY, BUNDLER, AND YARN #================================================= ynh_script_progression --message="Installing Ruby dependencies..." --weight=10 @@ -120,6 +119,13 @@ pushd "$final_path/live" ynh_gem install bundler --no-document popd +ynh_script_progression --message="Installing Yarn dependencies..." --weight=10 + +pushd "$final_path/live" + corepack enable + yarn install +popd + #================================================= # RESTORE VARIOUS FILES #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 6083778..57f890a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -275,7 +275,6 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=10 ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$NODEJS_VERSION -ynh_exec_warn_less ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" ynh_exec_warn_less ynh_install_ruby --ruby_version=$RUBY_VERSION #================================================= @@ -341,7 +340,8 @@ then 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 install -j$(getconf _NPROCESSORS_ONLN) ynh_use_nodejs - ynh_exec_as $app $ynh_node_load_PATH yarn install --pure-lockfile + corepack enable + yarn install ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:clean ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:precompile ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails db:migrate