mirror of
https://github.com/YunoHost-Apps/mattermost_ynh.git
synced 2024-09-03 19:36:29 +02:00
Update upgrade
This commit is contained in:
parent
7fe1b730a9
commit
f8da8df9e7
1 changed files with 19 additions and 2 deletions
|
@ -122,11 +122,28 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Upgrading source files..." --weight=2
|
ynh_script_progression --message="Upgrading source files..." --weight=2
|
||||||
|
|
||||||
|
# Create a temporary directory
|
||||||
|
tmpdir="$(mktemp -d)"
|
||||||
|
|
||||||
|
# Backup the config file and local plugins in the temp dir
|
||||||
|
cp -a "$final_path/config/config.json" "$tmpdir/config.json"
|
||||||
|
cp -ar "$final_path/plugins" "$tmpdir/plugins"
|
||||||
|
|
||||||
|
# Remove the app directory securely
|
||||||
|
ynh_secure_remove --file="$final_path"
|
||||||
|
|
||||||
if [ "$version" = "Enterprise" ]; then
|
if [ "$version" = "Enterprise" ]; then
|
||||||
ynh_setup_source --dest_dir="$final_path" --source_id="enterprise" --keep="$final_path/plugins $final_path/config/config.json"
|
ynh_setup_source --dest_dir="$final_path" --source_id="enterprise"
|
||||||
elif [ "$version" = "Team" ]; then
|
elif [ "$version" = "Team" ]; then
|
||||||
ynh_setup_source --dest_dir="$final_path" --source_id="$YNH_ARCH" --keep="$final_path/plugins $final_path/config/config.json"
|
ynh_setup_source --dest_dir="$final_path" --source_id="$YNH_ARCH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Copy the admin saved settings and plugins from tmp directory to final path
|
||||||
|
cp -a "$tmpdir/config.json" "$final_path/config/config.json"
|
||||||
|
cp -ar --no-clobber "$tmpdir/plugins" "$final_path/"
|
||||||
|
|
||||||
|
# Remove the tmp directory securely
|
||||||
|
ynh_secure_remove --file="$tmpdir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chmod 750 "$final_path"
|
chmod 750 "$final_path"
|
||||||
|
|
Loading…
Add table
Reference in a new issue