Global upgrade

This commit is contained in:
Maniack Crudelis
2019-02-10 15:02:38 +01:00
parent 57cceced5d
commit 05d5511136
9 changed files with 114 additions and 28 deletions

View File

@@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
ynh_print_info "Load settings"
app=$YNH_APP_INSTANCE_NAME
@@ -26,6 +27,7 @@ db_name=$(ynh_app_setting_get $app db_name)
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_print_info "Ensure downward compatibility"
# Fix is_public as a boolean value
if [ "$is_public" = "Yes" ]; then
@@ -51,6 +53,7 @@ fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_print_info "Backup the app before upgrading"
# Backup the current version of the app
ynh_backup_before_upgrade
@@ -73,6 +76,7 @@ path_url=$(ynh_normalize_url_path $path_url)
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_print_info "Download, check and unpack source"
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path"
@@ -80,6 +84,7 @@ ynh_setup_source "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_print_info "Reconfigure nginx"
# Create a dedicated nginx config
ynh_add_nginx_config
@@ -87,12 +92,14 @@ ynh_add_nginx_config
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_print_info "Upgrade dependencies"
ynh_install_app_dependencies deb1 deb2
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_print_info "Create a dedicated user"
# Create a dedicated user (if not existing)
ynh_system_user_create $app
@@ -100,6 +107,7 @@ ynh_system_user_create $app
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_print_info "Reconfigure php-fpm"
# Create a dedicated php-fpm config
ynh_add_fpm_config
@@ -119,6 +127,7 @@ ynh_store_file_checksum "$final_path/CONFIG_FILE"
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_print_info "Reconfigure logrotate"
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append
@@ -126,6 +135,7 @@ ynh_use_logrotate --non-append
#=================================================
# SETUP SYSTEMD
#=================================================
ynh_print_info "Reconfigure systemd"
# Create a dedicated systemd config
ynh_add_systemd_config
@@ -142,6 +152,7 @@ chown -R root: $final_path
#=================================================
# SETUP SSOWAT
#=================================================
ynh_print_info "Reconfigure SSOwat"
# Make app public if necessary
if [ $is_public -eq 1 ]
@@ -153,5 +164,12 @@ fi
#=================================================
# RELOAD NGINX
#=================================================
ynh_print_info "Reload nginx"
systemctl reload nginx
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info "Upgrade completed"