From 1abced33e6a4102c5545810df7981ef0f64f914e Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Fri, 20 Oct 2017 11:48:26 +0200 Subject: [PATCH] Add upgrade script skeleton --- scripts/upgrade | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 scripts/upgrade diff --git a/scripts/upgrade b/scripts/upgrade new file mode 100644 index 0000000..646833b --- /dev/null +++ b/scripts/upgrade @@ -0,0 +1,41 @@ +#!/bin/bash +# Exit on command errors and treat unset variables as an error +set -eu + +#================================================= +# GENERIC STARTING +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source _common.sh +source /usr/share/yunohost/helpers + +#================================================= +# LOAD SETTINGS +#================================================= + +app=$YNH_APP_INSTANCE_NAME + +pvp=$(ynh_app_setting_get $app pvp) +damage=$(ynh_app_setting_get $app damage) +domain=$(ynh_app_setting_get $app domain) +creative=$(ynh_app_setting_get $app creative) +is_public=$(ynh_app_setting_get $app is_public) + +#================================================= +# 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 + +#================================================= +# STANDARD UPGRADE STEPS +#================================================= +# nothing yet