aboutsummaryrefslogtreecommitdiff
path: root/scripts/upgrade
diff options
context:
space:
mode:
authornemsia <nemsia@nemsia.org>2018-05-23 00:08:40 +0200
committerGitHub <noreply@github.com>2018-05-23 00:08:40 +0200
commita6d9ee92f954dcd9cddb7d26c045e1835b612cc5 (patch)
tree303a17b343ac81c567d208d805a106ebb680de65 /scripts/upgrade
parent1d7613889c5e0ef976e3ed63e4ad82516508f5a9 (diff)
downloadmastodon_ynh-a6d9ee92f954dcd9cddb7d26c045e1835b612cc5.tar.gz
mastodon_ynh-a6d9ee92f954dcd9cddb7d26c045e1835b612cc5.tar.bz2
mastodon_ynh-a6d9ee92f954dcd9cddb7d26c045e1835b612cc5.zip
Upgrade 2.4 (#79)
* Upgrade rb to 2.5.1 * Update upgrade * Fix 2.3.3 * Add trace on assets:precompile * Yarn install and precompile Update 2.4 need root to yarn install and precompile, Temporary bad fix. * Update upgrade * Fix migrate * Update README.md * Update manifest.json
Diffstat (limited to 'scripts/upgrade')
-rw-r--r--scripts/upgrade34
1 files changed, 20 insertions, 14 deletions
diff --git a/scripts/upgrade b/scripts/upgrade
index 50904f1..aa87ffb 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -67,35 +67,41 @@ fi
# add additional package for upgrade
ynh_package_install pkg-config libprotobuf-dev protobuf-compiler libicu-dev libidn11-dev postgresql-server-dev-9.4
-# Install ruby 2.5.0 for release 2.0
+# Install ruby 2.5.1 for release 2.4.0
sudo su - $app <<RCOMMANDS
cd $final_path/.rbenv && git pull && cd -
cd $final_path/.rbenv/plugins/ruby-build && git pull && cd -
-$final_path/.rbenv/bin/rbenv install 2.5.0 || true
-$final_path/.rbenv/versions/2.5.0/bin/ruby -v
+$final_path/.rbenv/bin/rbenv install 2.5.1 || true
+$final_path/.rbenv/versions/2.5.1/bin/ruby -v
RCOMMANDS
-# Create symlink for ruby 2.5.0
+# Create symlink for ruby 2.5.1
sudo rm /usr/bin/ruby || true
-sudo ln -s $final_path/.rbenv/versions/2.5.0/bin/ruby /usr/bin/ruby || true
+sudo ln -s $final_path/.rbenv/versions/2.5.1/bin/ruby /usr/bin/ruby || true
# Install Mastodon
sudo su - $app <<MCOMMANDS
pushd ~/live
-$final_path/.rbenv/versions/2.5.0/bin/gem install bundler
-bin/bundle install --deployment --without development test
-yarn install --pure-lockfile
+$final_path/.rbenv/versions/2.5.1/bin/gem install bundler
+$final_path/.rbenv/versions/2.5.1/bin/bundle install --deployment --without development test
+#yarn install --pure-lockfile
MCOMMANDS
+pushd $final_path/live
+yarn install --pure-lockfile
+popd
+
# Apply Mastodon upgrade
-sudo su - $app <<COMMANDS
+pushd $final_path/live
+RAILS_ENV=production $final_path/.rbenv/versions/2.5.1/bin/bundle exec rails assets:clean
+RAILS_ENV=production $final_path/.rbenv/versions/2.5.1/bin/bundle exec rails assets:precompile --trace
+
+sudo su - $app <<UCOMMANDS
pushd ~/live
-RAILS_ENV=production bundle exec rails assets:clean
-RAILS_ENV=production bundle exec rails assets:precompile
-RAILS_ENV=production bundle exec rails db:migrate
+RAILS_ENV=production $final_path/.rbenv/versions/2.5.1/bin/bundle exec rails db:migrate
# Upgrade to 2.2.0
-RAILS_ENV=production bundle exec rails mastodon:maintenance:remove_regeneration_markers
-COMMANDS
+RAILS_ENV=production $final_path/.rbenv/versions/2.5.1/bin/bundle exec rails mastodon:maintenance:remove_regeneration_markers
+UCOMMANDS
# Restart Mastodon
sudo systemctl start mastodon-*.service