aboutsummaryrefslogtreecommitdiff
path: root/scripts/upgrade
diff options
context:
space:
mode:
authoranmol <github@datamol.org>2018-11-07 09:42:21 +0530
committeranmol <github@datamol.org>2018-11-07 09:42:21 +0530
commit9d07d121ad516bf0d3db1c5eb700cb6575630802 (patch)
tree8ce15bdd606cbbacb538457f628b997af40d05c5 /scripts/upgrade
parent7b33bf4f034e701262de23cb5193e3fdd184311f (diff)
downloadmastodon_ynh-9d07d121ad516bf0d3db1c5eb700cb6575630802.tar.gz
mastodon_ynh-9d07d121ad516bf0d3db1c5eb700cb6575630802.tar.bz2
mastodon_ynh-9d07d121ad516bf0d3db1c5eb700cb6575630802.zip
Upgrade error fix and cron job
Diffstat (limited to 'scripts/upgrade')
-rw-r--r--scripts/upgrade10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/upgrade b/scripts/upgrade
index 6b03973..f837c9c 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -107,7 +107,11 @@ yunohost service stop "$app-sidekiq"
yunohost service stop "$app-streaming"
# Download Mastodon
+mv "$final_path/live" "$final_path/live_back"
ynh_setup_source "$final_path/live" "app-mastodon"
+rsync -a "$final_path/live_back/public/system" "$final_path/live_back/public/."
+rsync -a "$final_path/live_back/.env.production" "$final_path/live/."
+rm -Rf "$final_path/live_back"
# Clean files which are not needed anymore
ynh_secure_remove $final_path/live/config/initializers/timeout.rb
@@ -154,7 +158,6 @@ MCOMMANDS
# Install package with yarn and restart postgresql
pushd $final_path/live
yarn install --pure-lockfile
-npm install -D babel-loader @babel/core @babel/preset-env webpack
systemctl restart postgresql
popd
@@ -197,6 +200,11 @@ yunohost service start "$app-streaming"
# Waiting start all services
sleep 30
+# SETUP CRON JOB FOR REMOVING CACHE
+ynh_replace_string "__FINAL_PATH__" "$final_path" ../conf/cron
+ynh_replace_string "__USER__" "$app" ../conf/cron
+sudo cp -f ../conf/cron /etc/cron.d/$app
+
#=================================================
# RELOAD NGINX
#=================================================