mirror of
https://github.com/YunoHost-Apps/moodle_ynh.git
synced 2024-09-03 19:46:23 +02:00
Update upgrade
This commit is contained in:
parent
c2c725c522
commit
6ba0052c7d
1 changed files with 17 additions and 5 deletions
|
@ -78,11 +78,23 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Upgrading source files..." --weight=6
|
ynh_script_progression --message="Upgrading source files..." --weight=6
|
||||||
|
|
||||||
|
# Create a temporary directory
|
||||||
|
tmpdir="$(mktemp -d)"
|
||||||
|
|
||||||
|
# Backup the config file in the temp dir
|
||||||
|
cp -a "$final_path/config.php" "$tmpdir/config.php"
|
||||||
|
|
||||||
# Remove the app directory securely
|
# Remove the app directory securely
|
||||||
ynh_secure_remove --file="$final_path"
|
ynh_secure_remove --file="$final_path"
|
||||||
|
|
||||||
# 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"
|
||||||
|
|
||||||
|
# Copy the admin saved settings from tmp directory to final path
|
||||||
|
cp -a "$tmpdir/config.php" "$final_path/config.php"
|
||||||
|
|
||||||
|
# Remove the tmp directory securely
|
||||||
|
ynh_secure_remove --file="$tmpdir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chmod 750 "$final_path"
|
chmod 750 "$final_path"
|
||||||
|
@ -116,14 +128,14 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADING THE APPLICATION
|
# UPGRADING THE APPLICATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading the application..." --weight=1
|
# ynh_script_progression --message="Upgrading the application..." --weight=1
|
||||||
|
|
||||||
ynh_backup_if_checksum_is_different --file="$final_path/config.php"
|
# ynh_backup_if_checksum_is_different --file="$final_path/config.php"
|
||||||
|
|
||||||
ynh_exec_as $app php${phpversion} "$final_path/admin/cli/upgrade.php" --non-interactive
|
# ynh_exec_as $app php${phpversion} "$final_path/admin/cli/upgrade.php" --non-interactive
|
||||||
|
|
||||||
# Recalculate and store the checksum of the file for the next upgrade.
|
# # Recalculate and store the checksum of the file for the next upgrade.
|
||||||
ynh_store_file_checksum --file="$final_path/config.php"
|
# ynh_store_file_checksum --file="$final_path/config.php"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ACTIVATE LDAP SUPPORT
|
# ACTIVATE LDAP SUPPORT
|
||||||
|
|
Loading…
Reference in a new issue