diff options
| author | yalh76 <yalh@yahoo.com> | 2019-05-15 12:18:39 +0200 |
|---|---|---|
| committer | yalh76 <yalh@yahoo.com> | 2019-05-15 12:18:39 +0200 |
| commit | cd046117a5b300ba67faf4d6b25bb1c44fb774d2 (patch) | |
| tree | 01dbb6ee818e4ea0588ffa81529d730e834e3d46 /scripts/upgrade | |
| parent | f6bf3f01c9bbe6862cb8360e05245672e33963e5 (diff) | |
| download | mastodon_ynh-cd046117a5b300ba67faf4d6b25bb1c44fb774d2.tar.gz mastodon_ynh-cd046117a5b300ba67faf4d6b25bb1c44fb774d2.tar.bz2 mastodon_ynh-cd046117a5b300ba67faf4d6b25bb1c44fb774d2.zip | |
example_ynh corrections
Diffstat (limited to 'scripts/upgrade')
| -rw-r--r-- | scripts/upgrade | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/scripts/upgrade b/scripts/upgrade index 7562d85..1d35159 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -38,6 +38,12 @@ vapid_private_key=$(ynh_app_setting_get --app=$app --key=vapid_private_key) vapid_public_key=$(ynh_app_setting_get --app=$app --key=vapid_public_key) #================================================= +# CHECK VERSION +#================================================= + +upgrade_type=$(ynh_check_app_version_changed) + +#================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 @@ -140,19 +146,23 @@ ynh_systemd_action --service_name=${app}-streaming --action="stop" --log_path=sy #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Upgrading source files..." --weight=14 -# Download Mastodon -mv "$final_path/live" "$final_path/live_back" -ynh_setup_source --dest_dir="$final_path/live" -if [ -z $final_path/live_back/public/system ]; then - rsync -a "$final_path/live_back/public/system" "$final_path/live_back/public/." -fi -rsync -a "$final_path/live_back/.env.production" "$final_path/live/." -rm -Rf "$final_path/live_back" +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_script_progression --message="Upgrading source files..." --weight=14 -# Clean files which are not needed anymore -ynh_secure_remove --file="$final_path/live/config/initializers/timeout.rb" + # Download Mastodon + mv "$final_path/live" "$final_path/live_back" + ynh_setup_source --dest_dir="$final_path/live" + if [ -z $final_path/live_back/public/system ]; then + rsync -a "$final_path/live_back/public/system" "$final_path/live_back/public/." + fi + 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 --file="$final_path/live/config/initializers/timeout.rb" +fi #================================================= # NGINX CONFIGURATION |
