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

59 lines
1.7 KiB
Text
Raw Normal View History

2015-09-14 17:12:17 +02:00
#!/bin/bash
2017-05-18 23:28:18 +02:00
2018-05-21 15:44:09 +02:00
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2016-07-05 15:22:12 +02:00
# Source YunoHost helpers
2017-05-18 23:28:18 +02:00
source /usr/share/yunohost/helpers
source _future.sh
source _common.sh
2018-05-21 15:44:09 +02:00
#=================================================
# LOAD SETTINGS
#=================================================
2016-07-05 15:22:12 +02:00
# Retrieve arguments
2017-05-18 23:28:18 +02:00
export app=$YNH_APP_INSTANCE_NAME
export domain=$(ynh_app_setting_get "$app" domain)
export app_version=$(ynh_app_setting_get "$app" app_version)
2017-05-18 23:28:18 +02:00
export oca=$(ynh_app_setting_get "$app" oca)
export port=$(ynh_app_setting_get $app port)
2018-12-16 19:41:40 +01:00
export port_chat=$(ynh_app_setting_get $app port_chat)
2017-05-18 23:28:18 +02:00
export is_public=0
2018-12-16 19:41:40 +01:00
export final_path=$(ynh_app_setting_get $app final_path)
export conf_file=$(ynh_app_setting_get $app conf_file)
2019-04-17 22:45:59 +02:00
export preinstall=0
2017-05-18 23:28:18 +02:00
2018-05-21 15:44:09 +02:00
#=================================================
# CHECK VERSION
#=================================================
2017-05-18 23:28:18 +02:00
2018-12-16 19:41:40 +01:00
ynh_check_app_version_changed
2015-09-14 17:12:17 +02:00
2018-05-21 15:44:09 +02:00
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
2017-05-18 23:28:18 +02:00
2018-05-21 15:44:09 +02:00
#=================================================
# STEP Migrations
#=================================================
2018-12-14 03:36:58 +01:00
ynh_system_user_create $app
2018-12-14 19:49:43 +01:00
setup_files
2018-12-14 03:36:58 +01:00
install_dependencies
service $app restart