mirror of
https://github.com/YunoHost-Apps/castopod_ynh.git
synced 2024-09-03 18:16:14 +02:00
Fully replace sources during upgrade.
This commit is contained in:
parent
958e05b4bb
commit
1808971fa6
1 changed files with 13 additions and 9 deletions
|
@ -38,6 +38,17 @@ if [ -z "${fpm_usage:-}" ]; then
|
|||
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# MOVE DATA TO __DATA_DIR__
|
||||
#=================================================
|
||||
|
||||
if [ $(ynh_compare_current_package_version --comparison le --version "1.1.2~ynh2") ]; then
|
||||
ynh_script_progression --message="Moving data..." --weight=3
|
||||
mv $install_dir/public/media $data_dir
|
||||
chmod -R 644 $data_dir
|
||||
chgrp -R www-data $data_dir
|
||||
endif
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
@ -47,7 +58,7 @@ then
|
|||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$install_dir" --keep=".env public/media"
|
||||
ynh_setup_source --dest_dir="$install_dir" --full_replace=1
|
||||
fi
|
||||
|
||||
chmod -R o-rwx "$install_dir"
|
||||
|
@ -85,17 +96,10 @@ chown $app:www-data "$install_dir/.env"
|
|||
ynh_script_progression --message="Configuring $app database..." --weight=1
|
||||
|
||||
pushd $install_dir
|
||||
ynh_exec_warn_less ynh_exec_as $app php${phpversion} spark castopod:database-update
|
||||
ynh_exec_warn_less ynh_exec_as $app php${phpversion} spark cache:clear
|
||||
ynh_exec_warn_less ynh_exec_as $app php${phpversion} spark castopod:database-update
|
||||
popd
|
||||
|
||||
if [ $(ynh_compare_current_package_version --comparison le --version "1.1.2~ynh2") ]; then
|
||||
ynh_script_progression --message="Moving data..." --weight=3
|
||||
mv $install_dir/public/media $data_dir
|
||||
chmod -R 644 $data_dir
|
||||
chgrp -R www-data $data_dir
|
||||
endif
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue