diff options
| author | anmol <github@datamol.org> | 2018-11-07 09:42:21 +0530 |
|---|---|---|
| committer | anmol <github@datamol.org> | 2018-11-07 09:42:21 +0530 |
| commit | 9d07d121ad516bf0d3db1c5eb700cb6575630802 (patch) | |
| tree | 8ce15bdd606cbbacb538457f628b997af40d05c5 /scripts | |
| parent | 7b33bf4f034e701262de23cb5193e3fdd184311f (diff) | |
| download | mastodon_ynh-9d07d121ad516bf0d3db1c5eb700cb6575630802.tar.gz mastodon_ynh-9d07d121ad516bf0d3db1c5eb700cb6575630802.tar.bz2 mastodon_ynh-9d07d121ad516bf0d3db1c5eb700cb6575630802.zip | |
Upgrade error fix and cron job
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/backup | 6 | ||||
| -rw-r--r-- | scripts/install | 13 | ||||
| -rw-r--r-- | scripts/remove | 2 | ||||
| -rw-r--r-- | scripts/restore | 6 | ||||
| -rw-r--r-- | scripts/upgrade | 10 |
5 files changed, 32 insertions, 5 deletions
diff --git a/scripts/backup b/scripts/backup index bc1822a..eeee720 100644 --- a/scripts/backup +++ b/scripts/backup @@ -74,6 +74,12 @@ ynh_backup "/etc/systemd/system/$app-sidekiq.service" ynh_backup "/etc/systemd/system/$app-streaming.service" #================================================= +# BACKUP THE CRON FILE +#================================================= + +ynh_backup "/etc/cron.d/$app" + +#================================================= # BACKUP THE sources.list FILES #================================================= diff --git a/scripts/install b/scripts/install index e82774b..d457b8b 100644 --- a/scripts/install +++ b/scripts/install @@ -161,14 +161,14 @@ eval \"\$(rbenv init -)\"" > $final_path/.profile # Install ruby-build ( - exec_as "$app" $final_path/.rbenv/bin/rbenv install 2.5.1 - exec_as "$app" $final_path/.rbenv/bin/rbenv global 2.5.1 - exec_as "$app" $final_path/.rbenv/versions/2.5.1/bin/ruby -v + exec_as "$app" $final_path/.rbenv/bin/rbenv install 2.5.3 + exec_as "$app" $final_path/.rbenv/bin/rbenv global 2.5.3 + exec_as "$app" $final_path/.rbenv/versions/2.5.3/bin/ruby -v ) # Create symlink for ruby rm /usr/bin/ruby || true -ln -s $final_path/.rbenv/versions/2.5.1/bin/ruby /usr/bin/ruby || true +ln -s $final_path/.rbenv/versions/2.5.3/bin/ruby /usr/bin/ruby || true # Yarn install on root pushd $final_path/live @@ -260,6 +260,11 @@ yunohost service add "$app-web" yunohost service add "$app-sidekiq" yunohost service add "$app-streaming" +# 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 + #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/remove b/scripts/remove index b92d3b9..c6c6b05 100644 --- a/scripts/remove +++ b/scripts/remove @@ -85,6 +85,8 @@ ynh_remove_nginx_config # SPECIFIC REMOVE #================================================= +# Remove a cron file +ynh_secure_remove "/etc/cron.d/$app" #================================================= # REMOVE source.list diff --git a/scripts/restore b/scripts/restore index a25bb6f..822f8fc 100644 --- a/scripts/restore +++ b/scripts/restore @@ -147,6 +147,12 @@ yunohost service add $app-sidekiq yunohost service add $app-streaming #================================================= +# RESTORE THE CRON FILE +#================================================= + +ynh_restore_file "/etc/cron.d/$app" + +#================================================= # GENERIC FINALIZATION #================================================= # RELOAD NGINX AND services 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 #================================================= |
