mirror of
https://github.com/YunoHost-Apps/firefly-iii_ynh.git
synced 2024-09-03 18:36:13 +02:00
cleaning
This commit is contained in:
parent
8a4fe8eebc
commit
6ebc6bc82d
7 changed files with 66 additions and 47 deletions
|
@ -1,2 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# COMMON VARIABLES
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# EXPERIMENTAL HELPERS
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# FUTURE OFFICIAL HELPERS
|
||||
#=================================================
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
||||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
@ -9,8 +13,16 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
ynh_print_info --message="Declaring files to be backed up..."
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE APP MAIN DIR
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="$install_dir"
|
||||
|
||||
#=================================================
|
||||
# SYSTEM CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
|
@ -23,7 +27,7 @@ ynh_script_progression --message="Modifying a config file..."
|
|||
domain="$new_domain"
|
||||
path="$new_path"
|
||||
|
||||
ynh_add_config --template="../conf/.env" --destination="$install_dir/.env"
|
||||
ynh_add_config --template=".env" --destination="$install_dir/.env"
|
||||
chmod 400 "$install_dir/.env"
|
||||
chown $app "$install_dir/.env"
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ ynh_app_setting_set --app=$app --key=random_key --value=$random_key
|
|||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Setting up source files..."
|
||||
ynh_script_progression --message="Setting up source files..." --weight=1
|
||||
|
||||
ynh_setup_source --dest_dir=$install_dir
|
||||
|
||||
|
@ -22,19 +22,22 @@ chmod -R 775 $install_dir/storage
|
|||
#=================================================
|
||||
# SYSTEL CONFIGURATIONS
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Add system configurations related to $app..."
|
||||
ynh_script_progression --message="Add system configurations related to $app..." --weight=1
|
||||
|
||||
ynh_add_fpm_config
|
||||
|
||||
ynh_add_nginx_config
|
||||
|
||||
ynh_add_config --template="cron" --destination="/etc/cron.d/$app"
|
||||
chown root: "/etc/cron.d/$app"
|
||||
chmod 644 "/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
#=================================================
|
||||
# ADD A CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Adding $app configuration..."
|
||||
ynh_script_progression --message="Adding $app configuration..." --weight=1
|
||||
|
||||
ynh_add_config --template=".env" --destination="$install_dir/.env"
|
||||
|
||||
|
@ -44,7 +47,7 @@ chown $app "$install_dir/.env"
|
|||
#=================================================
|
||||
# DEPLOY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Deploying..."
|
||||
ynh_script_progression --message="Deploying..." --weight=1
|
||||
|
||||
pushd "$install_dir"
|
||||
php$phpversion artisan firefly-iii:upgrade-database
|
||||
|
@ -53,15 +56,6 @@ pushd "$install_dir"
|
|||
php$phpversion artisan passport:keys || true
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# SETUP A CRON
|
||||
#=================================================
|
||||
ynh_script_progression --message="Setuping a cron..."
|
||||
|
||||
ynh_add_config --template="cron" --destination="/etc/cron.d/$app"
|
||||
chown root: "/etc/cron.d/$app"
|
||||
chmod 644 "/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# REMOVE SYSTEM CONFIGURATIONS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing configurations related to $app..."
|
||||
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
|
||||
|
||||
ynh_remove_nginx_config
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
# RESTORE THE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the app main directory..."
|
||||
ynh_script_progression --message="Restoring the app main directory..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="$install_dir"
|
||||
|
||||
|
@ -17,14 +17,14 @@ chown -R $app:www-data "$install_dir"
|
|||
#=================================================
|
||||
# RESTORE THE MYSQL DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the MySQL database..."
|
||||
ynh_script_progression --message="Restoring the MySQL database..." --weight=1
|
||||
|
||||
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE PHP-FPM CONFIGURATION
|
||||
# RESTORE SYSTEM CONFIGURATIONS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring configurations related to $app..."
|
||||
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||
|
||||
|
@ -37,7 +37,7 @@ chmod 644 "/etc/cron.d/$app"
|
|||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..."
|
||||
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
|
|
@ -14,8 +14,7 @@ fi
|
|||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Upgrading source files..."
|
||||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||
|
||||
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep=".env storage"
|
||||
|
||||
|
@ -23,33 +22,33 @@ chmod -R o-rwx "$install_dir"
|
|||
chown -R $app:www-data "$install_dir"
|
||||
chmod -R 775 $install_dir/storage
|
||||
|
||||
#=================================================
|
||||
# PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading system configurations related to $app..."
|
||||
|
||||
ynh_add_fpm_config
|
||||
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC UPGRADE
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# UPDATE A CONFIG FILE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Updating $app configuration..."
|
||||
ynh_script_progression --message="Updating $app configuration..." --weight=1
|
||||
|
||||
ynh_add_config --template=".env" --destination="$install_dir/.env"
|
||||
|
||||
chmod 400 "$install_dir/.env"
|
||||
chown $app "$install_dir/.env"
|
||||
|
||||
#=================================================
|
||||
# REAPPLY SYSTEM CONFIGURATIONS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
|
||||
|
||||
ynh_add_fpm_config
|
||||
|
||||
ynh_add_nginx_config
|
||||
|
||||
ynh_add_config --template="cron" --destination="/etc/cron.d/$app"
|
||||
chown root: "/etc/cron.d/$app"
|
||||
chmod 644 "/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# DEPLOYMENT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading database..."
|
||||
ynh_script_progression --message="Upgrading database..." --weight=4
|
||||
|
||||
pushd "$install_dir"
|
||||
php$phpversion artisan migrate --seed
|
||||
|
@ -61,15 +60,6 @@ pushd "$install_dir"
|
|||
php$phpversion artisan view:clear
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# SETUP A CRON
|
||||
#=================================================
|
||||
ynh_script_progression --message="Setting up a cron job ..."
|
||||
|
||||
ynh_add_config --template="cron" --destination="/etc/cron.d/$app"
|
||||
chown root: "/etc/cron.d/$app"
|
||||
chmod 644 "/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue