2016-11-26 19:19:16 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-05-10 16:44:32 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2021-07-19 10:53:00 +02:00
|
|
|
#=================================================
|
|
|
|
# CHECK VERSION
|
|
|
|
#=================================================
|
2022-03-06 20:42:40 +01:00
|
|
|
ynh_script_progression --message="Checking version..."
|
2021-07-19 10:53:00 +02:00
|
|
|
|
|
|
|
upgrade_type=$(ynh_check_app_version_changed)
|
|
|
|
|
2022-03-06 20:42:40 +01:00
|
|
|
#=================================================
|
|
|
|
# STANDARD UPGRADE STEPS
|
2018-05-10 16:44:32 +02:00
|
|
|
#=================================================
|
|
|
|
# ENSURE DOWNWARD COMPATIBILITY
|
|
|
|
#=================================================
|
2021-07-19 10:53:00 +02:00
|
|
|
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
2016-11-26 19:19:16 +01:00
|
|
|
|
2018-05-10 16:44:32 +02:00
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
|
|
|
|
2021-07-19 10:53:00 +02:00
|
|
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|
|
|
then
|
|
|
|
ynh_script_progression --message="Upgrading source files..." --weight=4
|
|
|
|
|
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
2023-10-02 19:22:17 +02:00
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
2021-07-19 10:53:00 +02:00
|
|
|
fi
|
|
|
|
|
2023-10-02 19:22:17 +02:00
|
|
|
chmod 750 "$install_dir"
|
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R $app:www-data "$install_dir"
|
2018-05-10 16:44:32 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2021-07-19 10:53:00 +02:00
|
|
|
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
|
2016-11-26 19:19:16 +01:00
|
|
|
|
2018-05-10 16:44:32 +02:00
|
|
|
ynh_add_nginx_config
|
2016-11-26 19:19:16 +01:00
|
|
|
|
2018-05-10 16:44:32 +02:00
|
|
|
#=================================================
|
|
|
|
# PHP-FPM CONFIGURATION
|
|
|
|
#=================================================
|
2021-07-19 10:53:00 +02:00
|
|
|
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=3
|
2018-05-10 16:44:32 +02:00
|
|
|
|
|
|
|
ynh_add_fpm_config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC UPGRADE
|
|
|
|
#=================================================
|
2022-03-06 20:42:40 +01:00
|
|
|
# ...
|
|
|
|
#=================================================
|
2021-07-19 10:53:00 +02:00
|
|
|
ynh_script_progression --message="Running specific upgrade..." --weight=1
|
2019-05-08 14:42:53 +02:00
|
|
|
|
2019-05-11 00:27:31 +02:00
|
|
|
# Copy Yunohost custom script to cheky folder and launch it
|
2023-10-02 19:22:17 +02:00
|
|
|
cp yunohost_upgrade_cheky.php "$install_dir/others/update/"
|
2022-03-08 20:18:33 +01:00
|
|
|
# Upgrade disable because http://releases.cheky.net/releases.php no more exist
|
2023-10-02 19:22:17 +02:00
|
|
|
#ynh_exec_as "$app" /usr/bin/php$phpversion $install_dir/others/update/yunohost_upgrade_cheky.php $install_dir
|
2019-03-04 23:51:16 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-07-19 10:53:00 +02:00
|
|
|
ynh_script_progression --message="Upgrade of $app completed" --last
|