aboutsummaryrefslogtreecommitdiff
path: root/scripts/upgrade
diff options
context:
space:
mode:
authoryalh76 <yalh@yahoo.com>2019-11-22 01:24:17 +0100
committeryalh76 <yalh@yahoo.com>2019-11-22 01:24:17 +0100
commitf1ea723f4402b1adff2c393e1e7e207f0b301f7b (patch)
treef8524bdd392cc53ec71e66a0b38328f2740e8856 /scripts/upgrade
parent2183ce61cf4f6888aa5738bda6987f66e62be173 (diff)
downloadmastodon_ynh-f1ea723f4402b1adff2c393e1e7e207f0b301f7b.tar.gz
mastodon_ynh-f1ea723f4402b1adff2c393e1e7e207f0b301f7b.tar.bz2
mastodon_ynh-f1ea723f4402b1adff2c393e1e7e207f0b301f7b.zip
Fix upgrade step
Diffstat (limited to 'scripts/upgrade')
-rw-r--r--scripts/upgrade15
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/upgrade b/scripts/upgrade
index 38d85ea..5c763a4 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -169,13 +169,18 @@ then
ynh_script_progression --message="Upgrading source files..." --weight=14
# Download Mastodon
- mv "$final_path/live" "$final_path/live_back"
+ tmpdir="$(mktemp -d)"
+
+ mkdir $tmpdir/system
+ rsync -a "$final_path/live/public/system" "$tmpdir/."
+ rsync -a "$final_path/live/.env.production" "$tmpdir/."
+ ynh_secure_remove --file="$final_path/live/"
ynh_setup_source --dest_dir="$final_path/live"
- if [ -d "$final_path/live_back/public/system" ]; then
- rsync -a "$final_path/live_back/public/system" "$final_path/live/public/."
+ if [ -d "$tmpdir/system" ]; then
+ rsync -a "$tmpdir/system" "$final_path/live/public/."
fi
- rsync -a "$final_path/live_back/.env.production" "$final_path/live/."
- ynh_secure_remove --file="$final_path/live_back/"
+ rsync -a "$tmpdir/.env.production" "$final_path/live/."
+ ynh_secure_remove --file="$tmpdir/"
# Clean files which are not needed anymore
ynh_secure_remove --file="$final_path/live/config/initializers/timeout.rb"