aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorNemsia <nemsia@nemsia.org>2017-10-11 21:39:04 +0200
committerNemsia <nemsia@nemsia.org>2017-10-11 21:39:04 +0200
commitc687c563053e435032a23548bee3d46dc463bb40 (patch)
treec6fdab851d41fb12dd5b15f20f0e353a9785d9ae /scripts
parent2955707e9201499a03e9d9cb109f08ae25b288c9 (diff)
parent244edb7dc5c84be752e6978abbe59e9b73f521b1 (diff)
downloadmastodon_ynh-c687c563053e435032a23548bee3d46dc463bb40.tar.gz
mastodon_ynh-c687c563053e435032a23548bee3d46dc463bb40.tar.bz2
mastodon_ynh-c687c563053e435032a23548bee3d46dc463bb40.zip
Merge branch 'upgrade-from-pre-release'
Diffstat (limited to 'scripts')
-rw-r--r--scripts/install3
-rw-r--r--scripts/upgrade26
2 files changed, 23 insertions, 6 deletions
diff --git a/scripts/install b/scripts/install
index 217ca34..cb4adb5 100644
--- a/scripts/install
+++ b/scripts/install
@@ -102,10 +102,9 @@ CLONECOMMANDS
# Switch branch to tagged release
cd $final_path/live
-version=$(curl -s https://api.github.com/repos/tootsuite/mastodon/releases/latest | grep tag_name | cut -d\" -f4)
sudo su - $app <<SWITCHCOMMANDS
pushd ~/live
-git checkout $version
+git checkout $(git tag -l | sort -V | tail -n 1)
SWITCHCOMMANDS
# Be king rewind (/var/cache/yunohost/from_file/scripts)
diff --git a/scripts/upgrade b/scripts/upgrade
index 4e84b0d..e734e97 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -50,10 +50,9 @@ PULLCOMMANDS
# Switch branch to tagged release
cd $final_path/live
-version=$(curl -s https://api.github.com/repos/tootsuite/mastodon/releases/latest | grep tag_name | cut -d\" -f4)
sudo su - $app <<SWITCHCOMMANDS
pushd ~/live
-git checkout $version
+git checkout $(git tag -l | sort -V | tail -n 1)
SWITCHCOMMANDS
# upgrade Node.js v4 to v6
@@ -67,11 +66,30 @@ 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
+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
+RCOMMANDS
+
+# Create symlink for ruby 2.4.2
+sudo ln -s $final_path/.rbenv/versions/2.4.2/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
+bin/bundle install --deployment --without development test
+yarn install --pure-lockfile
+MCOMMANDS
+
# Apply Mastodon upgrade
sudo su - $app <<COMMANDS
pushd ~/live
-bin/bundle install
-yarn install --pure-lockfile
+#bin/bundle install
+#yarn install --pure-lockfile
# For 1.4.1 -> 1.4.2 migration prepare_for_foreign_keys is needed
# RAILS_ENV=production bundle exec rails mastodon:maintenance:prepare_for_foreign_keys
RAILS_ENV=production bundle exec rails assets:clean