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)
|
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
|
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"
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path) || ynh_die "This path already contains a folder"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -38,7 +37,6 @@ upgrade_type=$(ynh_check_app_version_changed)
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1
|
ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1
|
||||||
|
|
||||||
# Fix is_public as a boolean value
|
# 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
|
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
|
bdd=/var/www/garradin/association.sqlite
|
||||||
cp -avr /var/www/garradin/www/squelettes /tmp/squelettes
|
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
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
|
@ -106,11 +114,10 @@ ynh_install_app_dependencies $pkg_dependencies
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Upgrading source files..." --time --weight=1
|
||||||
|
|
||||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Upgrading source files..." --time --weight=1
|
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$final_path"
|
ynh_setup_source --dest_dir="$final_path"
|
||||||
fi
|
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, 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
|
if [ -d "$backup_squelettes" ]
|
||||||
sudo cp -avr /tmp/squelettes $final_path/www/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
|
# NGINX CONFIGURATION
|
||||||
|
@ -142,7 +157,6 @@ ynh_script_progression --message="Upgrading nginx web server configuration..." -
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated nginx config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue