aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authornemsia <nemsia@nemsia.org>2018-01-31 17:02:43 +0100
committerGitHub <noreply@github.com>2018-01-31 17:02:43 +0100
commita8f28533790c40d691327b09f2ac3e42176a6858 (patch)
tree3fa3051e39d0a3d0414dbfc55559c4f338fdb73d /scripts
parent5295228ca35226fd7c931096ec0e71677f66fd26 (diff)
downloadmastodon_ynh-a8f28533790c40d691327b09f2ac3e42176a6858.tar.gz
mastodon_ynh-a8f28533790c40d691327b09f2ac3e42176a6858.tar.bz2
mastodon_ynh-a8f28533790c40d691327b09f2ac3e42176a6858.zip
Upgrade to 2.2.0 (#65)
* Upgrade ruby to 2.5.0 * Add remove_regeneration_markers * Update README.md
Diffstat (limited to 'scripts')
-rw-r--r--scripts/install9
-rw-r--r--scripts/upgrade15
2 files changed, 14 insertions, 10 deletions
diff --git a/scripts/install b/scripts/install
index f3ac754..0027f6d 100644
--- a/scripts/install
+++ b/scripts/install
@@ -122,17 +122,18 @@ COMMANDS
# Install ruby-build
sudo su - $app <<RCOMMANDS
-/opt/mastodon/.rbenv/bin/rbenv install 2.4.2
-/opt/mastodon/.rbenv/versions/2.4.2/bin/ruby -v
+/opt/mastodon/.rbenv/bin/rbenv install 2.5.0
+/opt/mastodon/.rbenv/versions/2.5.0/bin/ruby -v
RCOMMANDS
# Create symlink for ruby
-sudo ln -s /opt/mastodon/.rbenv/versions/2.4.2/bin/ruby /usr/bin/ruby || true
+sudo rm /usr/bin/ruby
+sudo ln -s /opt/mastodon/.rbenv/versions/2.5.0/bin/ruby /usr/bin/ruby || true
# Install Mastodon
sudo su - $app <<MCOMMANDS
pushd ~/live
-/opt/mastodon/.rbenv/versions/2.4.2/bin/gem install bundler
+/opt/mastodon/.rbenv/versions/2.5.0/bin/gem install bundler
bin/bundle install --deployment --without development test
yarn install --production
MCOMMANDS
diff --git a/scripts/upgrade b/scripts/upgrade
index 0c469bb..ba7b27f 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -67,21 +67,22 @@ 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.4.2 for release 2.0
+# Install ruby 2.5.0 for release 2.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.4.2 || true
-$final_path/.rbenv/versions/2.4.2/bin/ruby -v
+$final_path/.rbenv/bin/rbenv install 2.5.0 || true
+$final_path/.rbenv/versions/2.5.0/bin/ruby -v
RCOMMANDS
-# Create symlink for ruby 2.4.2
-sudo ln -s $final_path/.rbenv/versions/2.4.2/bin/ruby /usr/bin/ruby || true
+# Create symlink for ruby 2.5.0
+sudo rm /usr/bin/ruby
+sudo ln -s $final_path/.rbenv/versions/2.5.0/bin/ruby /usr/bin/ruby || true
# Install Mastodon
sudo su - $app <<MCOMMANDS
pushd ~/live
-$final_path/.rbenv/versions/2.4.2/bin/gem install bundler
+$final_path/.rbenv/versions/2.5.0/bin/gem install bundler
bin/bundle install --deployment --without development test
yarn install --pure-lockfile
MCOMMANDS
@@ -92,6 +93,8 @@ 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
+# Upgrade to 2.2.0
+RAILS_ENV=production bundle exec rails mastodon:maintenance:remove_regeneration_markers
COMMANDS
# Restart Mastodon