1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/garradin_ynh.git synced 2024-09-03 18:36:17 +02:00

try to save sqlite bdd since upgarade

This commit is contained in:
Rodolphe Robles 2020-04-04 08:40:29 +02:00
parent 330a4107e8
commit 50316c0cb9
2 changed files with 39 additions and 45 deletions

View file

@ -18,8 +18,8 @@ final_path=/var/www/$app
#=================================================
# backup the bdd
#=================================================
sudo cp /tmp/association.sqlite $final_path/association.sqlite
sudo cp -a /tmp/association.sqlite $final_path/association.sqlite
sudo cp -avr /tmp/squelettes $final_path/www/squelettes
#=================================================
# Change options in file config.dist.php

View file

@ -49,17 +49,11 @@ elif [ "$is_public" = "No" ]; then
is_public=0
fi
# If final_path doesn't exist, create it
if [ -z "$final_path" ]; then
final_path=/var/www/$app
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi
#=================================================
# Backup squlite
#=================================================
sudo cp -a $final_path/association.sqlite /tmp/association.sqlite
sudo cp -avr $final_path/association.sqlite /tmp/association.sqlite
sudo cp -avr $final_path/www/squelettes /tmp/squelettes
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -74,29 +68,36 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
# #=================================================
# # CHECK THE PATH
# #=================================================
# # Normalize the URL path syntax
# # N.B. : this is for app installations before YunoHost 2.7
# # where this value might be something like /foo/ or foo/
# # instead of /foo ....
# # If nobody installed your app before 2.7, then you may
# # safely remove this line
# path_url=$(ynh_normalize_url_path --path_url=$path_url)
# final_path=/var/www/$app
# test ! -e "$final_path" || ynh_die "This path already contains a folder"
# # Normalize the url path syntax
# path_url=$(ynh_normalize_url_path $path_url)
# # Check web path availability
# ynh_webpath_available $domain $path_url
# # Register (book) web path
# ynh_webpath_register $app $domain $path_url
#=================================================
# CHECK THE PATH
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --time --weight=1
# Normalize the URL path syntax
# N.B. : this is for app installations before YunoHost 2.7
# where this value might be something like /foo/ or foo/
# instead of /foo ....
# If nobody installed your app before 2.7, then you may
# safely remove this line
path_url=$(ynh_normalize_url_path --path_url=$path_url)
final_path=/var/www/$app
test ! -e "$final_path" || ynh_die "This path already contains a folder"
# Normalize the url path syntax
path_url=$(ynh_normalize_url_path $path_url)
# Check web path availability
ynh_webpath_available $domain $path_url
# Register (book) web path
ynh_webpath_register $app $domain $path_url
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -110,13 +111,6 @@ then
ynh_setup_source --dest_dir="$final_path"
fi
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --time --weight=1
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -134,15 +128,15 @@ ynh_script_progression --message="Making sure dedicated system user exists..." -
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================
# #=================================================
# # STORE THE CONFIG FILE CHECKSUM
# #=================================================
### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
ynh_backup_if_checksum_is_different --file="$final_path/CONFIG_FILE"
# Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$final_path/CONFIG_FILE"
# ### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
# ### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
# ynh_backup_if_checksum_is_different --file="$final_path/CONFIG_FILE"
# # Recalculate and store the checksum of the file for the next upgrade.
# ynh_store_file_checksum --file="$final_path/CONFIG_FILE"
#=================================================
# Files owned by user app