mirror of
https://github.com/YunoHost-Apps/garradin_ynh.git
synced 2024-09-03 18:36:17 +02:00
try to debug upgrade
This commit is contained in:
parent
51ed793aa8
commit
f52938879e
1 changed files with 23 additions and 9 deletions
|
@ -21,7 +21,6 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path) || ynh_die "This path already contains a folder"
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
#=================================================
|
||||
|
@ -38,7 +37,6 @@ upgrade_type=$(ynh_check_app_version_changed)
|
|||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1
|
||||
|
||||
# Fix is_public as a boolean value
|
||||
|
@ -55,8 +53,18 @@ fi
|
|||
#=================================================
|
||||
ynh_script_progression --message="Backing up the bdd and squelettes before upgrading (may take a while)..." --time --weight=1
|
||||
|
||||
cp -avr /var/www/garradin/association.sqlite /tmp/association.sqlite
|
||||
cp -avr /var/www/garradin/www/squelettes /tmp/squelettes
|
||||
bdd=/var/www/garradin/association.sqlite
|
||||
squelettes=/var/www/garradin//www/squelettes
|
||||
|
||||
if [ -d "$squelettes" ]
|
||||
then
|
||||
cp -ar $squelettes /tmp/squelettes
|
||||
fi
|
||||
|
||||
if [ -b "$bdd" ]
|
||||
then
|
||||
cp -ar $bdd /tmp/association.sqlite
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
|
@ -106,11 +114,10 @@ ynh_install_app_dependencies $pkg_dependencies
|
|||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading source files..." --time --weight=1
|
||||
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
then
|
||||
ynh_script_progression --message="Upgrading source files..." --time --weight=1
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path"
|
||||
fi
|
||||
|
@ -130,9 +137,17 @@ ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string
|
|||
#=================================================
|
||||
# backup bdd, squelettes directory and config.local.php
|
||||
#=================================================
|
||||
backup_bdd=/tmp/association.sqlite
|
||||
backup_squelettes=/tmp/squelettes
|
||||
|
||||
sudo cp -a /tmp/association.sqlite $final_path/association.sqlite
|
||||
sudo cp -avr /tmp/squelettes $final_path/www/squelettes
|
||||
if [ -d "$backup_squelettes" ]
|
||||
then
|
||||
cp -ar /tmp/squelettes $final_path/www/squelettes
|
||||
fi
|
||||
|
||||
if [ -b "$backup_bdd" ]
|
||||
cp -ar /tmp/association.sqlite $final_path/association.sqlite
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
|
@ -142,7 +157,6 @@ ynh_script_progression --message="Upgrading nginx web server configuration..." -
|
|||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue