make installation work

This commit is contained in:
Sebastian Gumprich
2021-08-29 19:34:44 +02:00
parent e1a9f61336
commit 6b652a5e24
4 changed files with 33 additions and 29 deletions
+20 -12
View File
@@ -98,11 +98,6 @@ then
ynh_setup_source --dest_dir="$final_path"
fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
chmod -R 755 $final_path/storage
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
@@ -110,6 +105,15 @@ ynh_script_progression --message="Upgrading dependencies..."
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# ADD A CRON JOB
#=================================================
ynh_script_progression --message="Adding a cron job..."
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app"
#=================================================
# NGINX CONFIGURATION
#=================================================
@@ -133,14 +137,15 @@ ynh_add_fpm_config --package="$extra_php_dependencies"
# MODIFY A CONFIG FILE
#=================================================
# if [ "$upgrade_type" == "UPGRADE_APP" ]
# then
# ynh_add_config --template="../conf/default.env" --destination="$final_path/.env"
# fi
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_add_config --template="../conf/default.env" --destination="$final_path/.env"
fi
#=================================================
# UPGRADE DATABASE
#=================================================
ynh_script_progression --message="Upgrading the database..."
pushd "$final_path"
@@ -148,16 +153,19 @@ pushd "$final_path"
php$phpversion artisan down --no-interaction --verbose
# Optimize the framework for better performance
php$phpversion artisan optimize --force --no-interaction --verbose
php$phpversion artisan optimize --no-interaction --verbose
# Run the database migrations
php$phpversion artisan migrate --no-interaction --verbose
php$phpversion artisan db:seed --class=UpdateSeeder --force --no-interaction --verbose
php$phpversion artisan migrate --force --no-interaction --verbose
# Bring the application out of maintenance mode
php$phpversion artisan up --no-interaction --verbose
popd
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# RELOAD NGINX
#=================================================