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

57 lines
2.1 KiB
Text
Raw Normal View History

2013-12-11 21:23:28 +01:00
#!/bin/bash
2020-10-20 23:28:09 +02:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
2017-03-08 23:34:00 +01:00
source /usr/share/yunohost/helpers
2021-07-21 15:23:29 +02:00
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
2024-01-18 11:54:18 +01:00
# ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
2021-06-20 18:24:46 +02:00
2020-11-22 22:56:21 +01:00
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
2024-01-18 11:54:18 +01:00
ynh_script_progression --message="Upgrading source files..." --weight=1
2020-11-22 22:56:21 +01:00
2024-01-18 11:54:18 +01:00
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="store/conf/hosts.xml store/conf/main.xml store/conf/installed.xml"
2020-11-22 22:56:21 +01:00
2024-01-07 13:10:56 +01:00
chmod -R o-rwx "$install_dir"
2024-01-18 11:54:18 +01:00
chown -R "$app:www-data" "$install_dir"
2021-07-21 14:51:44 +02:00
2020-11-22 22:56:21 +01:00
#=================================================
# Set Jappix configuration
#=================================================
2021-08-23 10:30:40 +02:00
ynh_script_progression --message="Configuring Jappix..." --weight=1
2020-11-22 22:24:16 +01:00
2024-01-07 13:10:56 +01:00
mkdir -p "$install_dir/store/conf"
ynh_add_config --template="../conf/hosts.xml" --destination="$install_dir/store/conf/hosts.xml"
ynh_add_config --template="../conf/main.xml" --destination="$install_dir/store/conf/main.xml"
ynh_add_config --template="../conf/installed.xml" --destination="$install_dir/store/conf/installed.xml"
2021-07-21 15:46:34 +02:00
2024-01-07 13:10:56 +01:00
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
2020-10-20 23:28:09 +02:00
#=================================================
2024-01-07 13:10:56 +01:00
# REAPPLY SYSTEM CONFIGURATIONS
2020-10-20 23:28:09 +02:00
#=================================================
2024-01-07 13:10:56 +01:00
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
2020-10-20 23:28:09 +02:00
2024-01-07 13:10:56 +01:00
# Create a dedicated nginx config
ynh_add_nginx_config
# Create a dedicated PHP-FPM config
ynh_add_fpm_config
2020-10-20 23:28:09 +02:00
#=================================================
# END OF SCRIPT
#=================================================
2020-11-22 22:17:57 +01:00
ynh_script_progression --message="Upgrade of $app completed" --last