mirror of
https://github.com/YunoHost-Apps/moodle_ynh.git
synced 2024-09-03 19:46:23 +02:00
Upgrade (#68)
* Apply example_ynh * Fix melange-de-versions https://forum.yunohost.org/t/melange-de-versions-de-moodle-detectees/19985 * Update manifest.json * Auto-update README Co-authored-by: yunohost-bot <yunohost@yunohost.org>
This commit is contained in:
parent
47d0def13d
commit
598cda214a
6 changed files with 24 additions and 7 deletions
|
@ -20,7 +20,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
|
|||
Moodle is widely used around the world by universities, schools, companies and all manner of organisations and individuals.
|
||||
|
||||
|
||||
**Shipped version:** 4.0.1~ynh2
|
||||
**Shipped version:** 4.0.1~ynh3
|
||||
|
||||
**Demo:** https://sandbox.moodledemo.net/
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
|
|||
Moodle est largement utilisé dans le monde entier par les universités, les écoles, les entreprises et toutes sortes d'organisations et d'individus.
|
||||
|
||||
|
||||
**Version incluse :** 4.0.1~ynh2
|
||||
**Version incluse :** 4.0.1~ynh3
|
||||
|
||||
**Démo :** https://sandbox.moodledemo.net/
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Online learning platform",
|
||||
"fr": "Plateforme d'apprentissage en ligne"
|
||||
},
|
||||
"version": "4.0.1~ynh2",
|
||||
"version": "4.0.1~ynh3",
|
||||
"url": "https://moodle.org/",
|
||||
"upstream": {
|
||||
"license": "GPL-3.0-or-later",
|
||||
|
|
|
@ -108,12 +108,16 @@ domain=${new_domain%/}
|
|||
path=${new_path%/}
|
||||
dir="__DIR__"
|
||||
|
||||
ynh_backup_if_checksum_is_different --file="$final_path/config.php"
|
||||
|
||||
if [ "$new_path" == "/" ]; then
|
||||
ynh_add_config --template="../conf/config-domain.php" --destination="$final_path/config.php"
|
||||
else
|
||||
ynh_add_config --template="../conf/config-path.php" --destination="$final_path/config.php"
|
||||
fi
|
||||
|
||||
ynh_store_file_checksum --file="$final_path/config.php"
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
|
|
|
@ -20,7 +20,7 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading settings..." --weight=1
|
||||
ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -59,7 +59,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
|
|||
|
||||
ynh_restore_file --origin_path="$final_path"
|
||||
|
||||
# Restore permissions on app files
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
|
|
@ -109,9 +109,23 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|||
then
|
||||
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
|
||||
ynh_secure_remove --file="$final_path"
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config.php"
|
||||
#php${phpversion} $final_path/admin/cli/upgrade.php
|
||||
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
|
||||
|
||||
chmod 750 "$final_path"
|
||||
|
|
Loading…
Reference in a new issue