2023-06-05 17:27:49 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
|
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
2024-06-23 09:19:26 +02:00
|
|
|
ynh_script_progression "Upgrading source files..."
|
2023-06-05 17:27:49 +02:00
|
|
|
|
2024-03-07 22:51:29 +01:00
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
2023-06-05 17:27:49 +02:00
|
|
|
|
2024-06-23 09:19:26 +02:00
|
|
|
ynh_replace --match="define('ENVIRONMENT', 'development');" --replace="define('ENVIRONMENT', 'production');" --file=$install_dir/index.php
|
2024-03-07 23:04:21 +01:00
|
|
|
|
2023-06-05 17:27:49 +02:00
|
|
|
chown -R $app:www-data "$install_dir"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REAPPLY SYSTEM CONFIGURATIONS
|
|
|
|
#=================================================
|
2024-06-23 09:19:26 +02:00
|
|
|
ynh_script_progression "Upgrading system configurations related to $app..."
|
2023-06-05 17:27:49 +02:00
|
|
|
|
2024-06-23 09:19:26 +02:00
|
|
|
ynh_config_add_phpfpm
|
2023-06-05 17:27:49 +02:00
|
|
|
|
2024-06-23 09:19:26 +02:00
|
|
|
ynh_config_add_nginx
|
2023-06-05 17:27:49 +02:00
|
|
|
|
2024-06-23 09:19:26 +02:00
|
|
|
ynh_config_add_logrotate
|
2023-06-05 17:27:49 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-06-23 09:19:26 +02:00
|
|
|
ynh_script_progression "Upgrade of $app completed"
|