mirror of
https://github.com/YunoHost-Apps/monica_ynh.git
synced 2024-09-03 19:46:23 +02:00
improve scripts
This commit is contained in:
parent
15bdedcb1d
commit
7265a3a35b
2 changed files with 15 additions and 25 deletions
|
@ -9,6 +9,15 @@
|
|||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
#=================================================
|
||||
|
||||
yunohost app checkurl "${domain}${path_url}" -a "$app" \
|
||||
|| ynh_die "Path not available: ${domain}${path_url}"
|
||||
test ! -d $final_path \
|
||||
|| ynh_die "There is already a directory: $final_path "
|
||||
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
@ -32,15 +41,6 @@ path_url=$(ynh_app_setting_get $app path)
|
|||
final_path=$(ynh_app_setting_get $app final_path)
|
||||
db_name=$(ynh_app_setting_get $app db_name)
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
#=================================================
|
||||
|
||||
yunohost app checkurl "${domain}${path_url}" -a "$app" \
|
||||
|| ynh_die "Path not available: ${domain}${path_url}"
|
||||
test ! -d $final_path \
|
||||
|| ynh_die "There is already a directory: $final_path "
|
||||
|
||||
#=================================================
|
||||
# STANDARD RESTORATION STEPS
|
||||
#=================================================
|
||||
|
@ -70,20 +70,6 @@ ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql
|
|||
# Create the dedicated user (if not existing)
|
||||
ynh_system_user_create $app
|
||||
|
||||
#=================================================
|
||||
# RESTORE USER RIGHTS
|
||||
#=================================================
|
||||
|
||||
# Restore permissions on app files
|
||||
chown -R www-data: $final_path
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
#ynh_restore_file "/etc/php5/fpm/pool.d/$app.conf"
|
||||
#ynh_restore_file "/etc/php5/fpm/conf.d/20-$app.ini"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC RESTORATION
|
||||
#=================================================
|
||||
|
@ -102,6 +88,11 @@ cd $final_path && sudo_path pnpm install
|
|||
cd $final_path && sudo_path pnpm install -g bower gulp
|
||||
cd $final_path && sudo_path bower install -f --allow-root
|
||||
|
||||
#=================================================
|
||||
# RESTORE USER RIGHTS
|
||||
#=================================================
|
||||
|
||||
# Restore permissions on app files
|
||||
chown -R www-data: $final_path
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -113,8 +113,7 @@ sudo sed -i "s/yunodomain/$domain/g" $final_path/.env
|
|||
## uses commas because path url contains a slash
|
||||
sudo sed -i "s,yunopath,${path_url},g" $final_path/.env
|
||||
|
||||
exec_composer "$final_path" update --quiet --no-dev --prefer-dist \
|
||||
|| ynh_die "Unable to update monica core dependencies"
|
||||
exec_composer "$final_path" update --quiet --no-dev --prefer-dist
|
||||
|
||||
# setup application config
|
||||
cd $final_path && sudo /usr/bin/php7.1 artisan migrate --force
|
||||
|
|
Loading…
Add table
Reference in a new issue