diff --git a/scripts/install b/scripts/install index f84b7cf..89bf6e3 100755 --- a/scripts/install +++ b/scripts/install @@ -10,7 +10,7 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST +# INITIALIZE AND STORE SETTINGS #================================================= timezone="$(cat /etc/timezone)" @@ -27,9 +27,19 @@ chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" #================================================= -# PHP-FPM CONFIGURATION +# APP INITIAL CONFIGURATION #================================================= -ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 +ynh_script_progression --message="Adding $app's configuration files..." --weight=1 + +ynh_add_config --template=".env.example" --destination="$install_dir/.env" + +chmod 400 "$install_dir/.env" +chown "$app:$app" "$install_dir/.env" + +#================================================= +# SYSTEM CONFIGURATION +#================================================= +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config @@ -54,20 +64,10 @@ ynh_script_progression --message="Installing app with Composer..." --weight=15 ynh_install_composer -#================================================= -# ADD A CONFIGURATION -#================================================= -ynh_script_progression --message="Adding a configuration file..." - -ynh_add_config --template=".env.example" --destination="$install_dir/.env" - -chmod 400 "$install_dir/.env" -chown "$app:$app" "$install_dir/.env" - #================================================= # BUILDING #================================================= -ynh_script_progression --message="Building..." --weight=10 +ynh_script_progression --message="configuring $app..." --weight=10 pushd "$install_dir" "php$phpversion" artisan key:generate -n --force --env diff --git a/scripts/remove b/scripts/remove index 61db822..5b17c2d 100755 --- a/scripts/remove +++ b/scripts/remove @@ -10,9 +10,9 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# REMOVE NGINX CONFIGURATION +# REMOVE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the dedicated NGINX config ynh_remove_nginx_config diff --git a/scripts/restore b/scripts/restore index 890e76e..11bafb0 100755 --- a/scripts/restore +++ b/scripts/restore @@ -23,16 +23,16 @@ chown -R "$app:www-data" "$install_dir" #================================================= # RESTORE THE DATA DIRECTORY #================================================= -ynh_script_progression --message="Restoring the data directory..." +ynh_script_progression --message="Restoring the data directory..." --weight=1 ynh_restore_file --origin_path="$data_dir" --not_mandatory chown -R "$app:www-data" "$data_dir" #================================================= -# RESTORE THE PHP-FPM CONFIGURATION +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." +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" @@ -45,7 +45,7 @@ ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -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 diff --git a/scripts/upgrade b/scripts/upgrade index 7154dff..2387cea 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,9 +23,19 @@ chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" #================================================= -# PHP-FPM CONFIGURATION +# UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 +ynh_script_progression --message="Updating a configuration file..." --weight=1 + +ynh_add_config --template=".env.example" --destination="$install_dir/.env" + +chmod 400 "$install_dir/.env" +chown "$app:$app" "$install_dir/.env" + +#================================================= +# REAPPLY SYSTEM CONFIGURATIONS +#================================================= +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config @@ -33,18 +43,6 @@ ynh_add_fpm_config # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SPECIFIC UPGRADE -#================================================= -# UPDATE A CONFIG FILE -#================================================= -ynh_script_progression --message="Updating a configuration file..." - -ynh_add_config --template=".env.example" --destination="$install_dir/.env" - -chmod 400 "$install_dir/.env" -chown "$app:$app" "$install_dir/.env" - #================================================= # INSTALL APP WITH COMPOSER #================================================= @@ -55,7 +53,7 @@ ynh_install_composer #================================================= # BUILDING #================================================= -ynh_script_progression --message="Building..." --weight=4 +ynh_script_progression --message="Configuring $app..." --weight=4 ynh_exec_warn_less ynh_composer_exec --commands="dump-autoload"