1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/cheky_ynh.git synced 2024-09-03 18:16:00 +02:00
cheky_ynh/scripts/upgrade

73 lines
2.4 KiB
Text
Raw Normal View History

#!/bin/bash
#=================================================
# 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
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
2021-07-19 10:53:00 +02:00
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
#=================================================
# 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"
#=================================================
# NGINX CONFIGURATION
#=================================================
2021-07-19 10:53:00 +02:00
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
ynh_add_nginx_config
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
2021-07-19 10:53:00 +02:00
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=3
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-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/"
# 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