reverseproxy_ynh/scripts/upgrade

60 lines
1.8 KiB
Text
Raw Normal View History

2018-05-26 10:27:01 +02:00
2016-06-20 23:43:51 +02:00
#!/bin/bash
2018-05-26 10:27:01 +02:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2023-01-08 14:33:31 +01:00
source _common.sh
2018-05-26 10:27:01 +02:00
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
2016-06-20 23:43:51 +02:00
# Retrieve arguments
2023-11-25 19:16:11 +01:00
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path)
#REMOVEME? proxy_path=$(ynh_app_setting_get --app=$app --key=proxy_path)
#REMOVEME? assets_path=$(ynh_app_setting_get --app=$app --key=assets_path)
2018-05-26 10:27:01 +02:00
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
# Backup the current version of the app
2023-11-25 19:16:11 +01:00
#REMOVEME? ynh_backup_before_upgrade
#REMOVEME? ynh_clean_setup () {
2018-05-26 10:27:01 +02:00
# restore it if the upgrade fails
2023-11-25 19:16:11 +01:00
#REMOVEME? ynh_restore_upgradebackup
2018-05-26 10:27:01 +02:00
}
# Exit if an error occurs during the execution of the script
2023-11-25 19:16:11 +01:00
#REMOVEME? ynh_abort_if_errors
2018-05-26 10:27:01 +02:00
2019-05-15 18:42:44 +02:00
#=================================================
# REVERSEPROXY_YNH
2019-05-15 18:42:44 +02:00
#=================================================
2023-01-08 14:33:31 +01:00
# Validate proxy destination
rp_validate_proxy_path
# Validate assets_path
rp_validate_assets_path
2023-11-25 19:16:11 +01:00
# Special case for "/" path
rp_handle_webroot
2018-05-26 10:27:01 +02:00
2023-01-08 14:33:31 +01:00
# Configure nginx
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
2023-11-25 19:16:11 +01:00
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
ynh_add_nginx_config
2021-01-23 15:21:17 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Upgrade of $app completed" --last