mirror of
https://github.com/YunoHost-Apps/opensondage_ynh.git
synced 2024-09-03 19:46:28 +02:00
commit
f93a2a7aee
1 changed files with 9 additions and 30 deletions
|
@ -16,23 +16,12 @@ source /usr/share/yunohost/helpers
|
||||||
email=$(ynh_user_get_info --username=$admin --key=mail)
|
email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||||
timezone="$(cat /etc/timezone)"
|
timezone="$(cat /etc/timezone)"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CHECK VERSION
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|
||||||
then
|
|
||||||
ynh_script_progression --message="Upgrading source files..." --weight=2
|
ynh_script_progression --message="Upgrading source files..." --weight=2
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
|
||||||
ynh_setup_source --dest_dir="$install_dir" --keep="app/inc/config.php"
|
ynh_setup_source --dest_dir="$install_dir" --keep="app/inc/config.php"
|
||||||
fi
|
|
||||||
|
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R $app:www-data "$install_dir"
|
chown -R $app:www-data "$install_dir"
|
||||||
|
@ -42,10 +31,8 @@ chown -R $app:www-data "$install_dir"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=3
|
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=3
|
||||||
|
|
||||||
# Create a dedicated PHP-FPM config
|
|
||||||
ynh_add_fpm_config
|
ynh_add_fpm_config
|
||||||
|
|
||||||
# Create a dedicated NGINX config
|
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -53,15 +40,12 @@ ynh_add_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPDATE A CONFIG FILE
|
# UPDATE A CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|
||||||
then
|
|
||||||
ynh_script_progression --message="Updating a configuration file..." --weight=2
|
ynh_script_progression --message="Updating a configuration file..." --weight=2
|
||||||
|
|
||||||
ynh_add_config --template="config.php" --destination="$install_dir/app/inc/config.php"
|
ynh_add_config --template="config.php" --destination="$install_dir/app/inc/config.php"
|
||||||
|
|
||||||
chmod 400 "$install_dir/app/inc/config.php"
|
chmod 400 "$install_dir/app/inc/config.php"
|
||||||
chown $app:$app "$install_dir/app/inc/config.php"
|
chown $app:$app "$install_dir/app/inc/config.php"
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REPLACE LOGO IMAGE (DEFAULT IS FRAMADATE)
|
# REPLACE LOGO IMAGE (DEFAULT IS FRAMADATE)
|
||||||
|
@ -78,16 +62,11 @@ touch "$install_dir/admin/stdout.log"
|
||||||
#=================================================
|
#=================================================
|
||||||
# RUN DATABASE UPGRADE
|
# RUN DATABASE UPGRADE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|
||||||
then
|
|
||||||
ynh_script_progression --message="Upgrading database..." --weight=2
|
ynh_script_progression --message="Upgrading database..." --weight=2
|
||||||
|
|
||||||
# Install composer
|
|
||||||
ynh_install_composer
|
ynh_install_composer
|
||||||
|
|
||||||
ynh_exec_warn_less php$phpversion "$install_dir/admin/migration.php"
|
ynh_exec_warn_less php$phpversion "$install_dir/admin/migration.php"
|
||||||
fi
|
|
||||||
|
|
||||||
chown -R $app: "$install_dir/"{tpl_c,admin/stdout.log}
|
chown -R $app: "$install_dir/"{tpl_c,admin/stdout.log}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue