1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pixelfed_ynh.git synced 2024-09-03 20:06:04 +02:00
This commit is contained in:
yalh76 2020-04-21 10:43:14 +02:00
parent 496f080193
commit b1a0c2a5cd
6 changed files with 41 additions and 2 deletions

1
conf/cron Normal file
View file

@ -0,0 +1 @@
* * * * * cd __FINALPATH__/ && php7.3 artisan schedule:run >> /dev/null 2>&1

View file

@ -86,6 +86,13 @@ ynh_print_info --message="Backing up supervisor configuration..."
ynh_backup --src_path="/etc/supervisor/conf.d/${app}-horizon.conf" ynh_backup --src_path="/etc/supervisor/conf.d/${app}-horizon.conf"
#=================================================
# BACKUP A CRON FILE
#=================================================
ynh_print_info --message="Backing up a cron file..."
ynh_backup --src_path="/etc/cron.d/$app"
#================================================= #=================================================
# START SUPERVISOR SERVICE # START SUPERVISOR SERVICE
#================================================= #=================================================

View file

@ -198,6 +198,14 @@ pushd "$final_path"
php7.3 artisan horizon:assets php7.3 artisan horizon:assets
popd popd
#=================================================
# INSTALL THE CRON FILE
#=================================================
ynh_print_info --message="Installing cron file..."
cp ../conf/cron "/etc/cron.d/$app"
ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="/etc/cron.d/$app"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================
@ -222,7 +230,7 @@ ynh_use_logrotate --logfile="/var/log/$app/${app}-horizon.log"
#================================================= #=================================================
ynh_print_info --message="Integrating service in YunoHost..." ynh_print_info --message="Integrating service in YunoHost..."
yunohost service add "${app}-horizon" --description "${app}-horizon daemon for $app" --log "/var/log/$app/${app}-horizon.log" yunohost service add "supervisor" --description "${app}-horizon daemon for $app" --log "/var/log/$app/${app}-horizon.log"
#================================================= #=================================================
# START SUPERVISOR SERVICE # START SUPERVISOR SERVICE

View file

@ -99,6 +99,14 @@ ynh_remove_logrotate
#================================================= #=================================================
# SPECIFIC REMOVE # SPECIFIC REMOVE
#=================================================
# REMOVE THE CRON FILE
#=================================================
ynh_print_info --message="Removing the cron file..."
# Remove a cron file
ynh_secure_remove --file="/etc/cron.d/$app"
#================================================= #=================================================
# REMOVE THE LOG FILE # REMOVE THE LOG FILE
#================================================= #=================================================

View file

@ -139,7 +139,7 @@ supervisorctl reread && supervisorctl update
#================================================= #=================================================
ynh_print_info --message="Integrating service in YunoHost..." ynh_print_info --message="Integrating service in YunoHost..."
yunohost service add "${app}-horizon" --log "/var/log/$app/${app}-horizon.log" yunohost service add "supervisor" --log "/var/log/$app/${app}-horizon.log"
#================================================= #=================================================
# START SUPERVISOR SERVICE # START SUPERVISOR SERVICE
@ -148,6 +148,13 @@ ynh_print_info --message="Starting a supervisor service..."
ynh_supervisor_action --service_name="${app}-horizon" --action="start" --log_path="/var/log/$app/${app}-horizon.log" ynh_supervisor_action --service_name="${app}-horizon" --action="start" --log_path="/var/log/$app/${app}-horizon.log"
#=================================================
# RESTORE THE CRON FILE
#=================================================
ynh_print_info --message="Restoring the cron file..."
ynh_restore_file --origin_path="/etc/cron.d/$app"
#================================================= #=================================================
# RESTORE THE LOGROTATE CONFIGURATION # RESTORE THE LOGROTATE CONFIGURATION
#================================================= #=================================================

View file

@ -226,6 +226,14 @@ mkdir -p "/var/log/$app/"
touch "/var/log/$app/${app}-horizon.log" touch "/var/log/$app/${app}-horizon.log"
chown -R root: "/var/log/$app/" chown -R root: "/var/log/$app/"
#=================================================
# UPGRADE THE CRON FILE
#=================================================
ynh_print_info --message="Upgrading cron file..."
cp ../conf/cron "/etc/cron.d/$app"
ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="/etc/cron.d/$app"
#================================================= #=================================================
# SETUP LOGROTATE # SETUP LOGROTATE
#================================================= #=================================================