aboutsummaryrefslogtreecommitdiff
path: root/scripts/upgrade
diff options
context:
space:
mode:
authornemsia <nemsia@nemsia.org>2017-04-30 00:01:11 +0200
committerGitHub <noreply@github.com>2017-04-30 00:01:11 +0200
commit5bcc59f37c0512c9c2adf6f3946770ade60f0f96 (patch)
treed117d00fc78c5fce3a9ae7404804b04816330fc7 /scripts/upgrade
parent3b3f95cfe38c83499a183518038c4db8119a3acf (diff)
downloadmastodon_ynh-5bcc59f37c0512c9c2adf6f3946770ade60f0f96.tar.gz
mastodon_ynh-5bcc59f37c0512c9c2adf6f3946770ade60f0f96.tar.bz2
mastodon_ynh-5bcc59f37c0512c9c2adf6f3946770ade60f0f96.zip
[enh] Switch to tagged release on upgrade
Diffstat (limited to 'scripts/upgrade')
-rw-r--r--scripts/upgrade14
1 files changed, 11 insertions, 3 deletions
diff --git a/scripts/upgrade b/scripts/upgrade
index 07b3ee7..d1f985e 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -37,12 +37,20 @@ sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
# Stop Mastodon Services
sudo systemctl stop mastodon-*.service
-# Update Mastodon
-sudo su - $app <<COMMANDS
+# Download Mastodon
+sudo su - $app <<PULLCOMMANDS
pushd ~/live
git fetch
git pull https://github.com/tootsuite/mastodon.git master
-git checkout $(git tag | tail -n 1)
+PULLCOMMANDS
+
+# Switch branch to tagged release
+pushd /opt/mastodon/live
+sudo git checkout $(git tag | tail -n 1)
+
+# Apply Mastodon upgrade
+sudo su - $app <<COMMANDS
+pushd ~/live
bin/bundle install
yarn install --pure-lockfile
RAILS_ENV=production bundle exec rails assets:clean