1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/fider_ynh.git synced 2024-09-03 18:36:11 +02:00

Fix upgrade (missing build), cleanup install and remove nodejs on remove

This commit is contained in:
Salamandar 2024-06-21 10:45:45 +02:00
parent 56c229b6cd
commit 1aa9296625
3 changed files with 26 additions and 4 deletions

View file

@ -64,14 +64,13 @@ ynh_add_systemd_config
yunohost service add "$app" --description="Fider Feedback platform" --log="/var/log/$app/$app.log" yunohost service add "$app" --description="Fider Feedback platform" --log="/var/log/$app/$app.log"
# Use logrotate to manage application logfile(s) # Use logrotate to manage application logfile(s)
ynh_use_logrotate --nonappend ynh_use_logrotate
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting a systemd service..." --weight=1
# Start a systemd service
ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log"
#================================================= #=================================================

View file

@ -28,6 +28,13 @@ ynh_remove_nginx_config
ynh_remove_nodejs ynh_remove_nodejs
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=1
ynh_remove_nodejs
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -30,24 +30,40 @@ if [ -d "/opt/yunohost/$app" ]; then
mv "/opt/yunohost/$app" "$install_dir" mv "/opt/yunohost/$app" "$install_dir"
fi fi
#=================================================
# UPDATE DEPENDENCIES
#=================================================
ynh_script_progression --message="Updating dependencies..." --weight=1
ynh_exec_warn_less ynh_install_go --go_version=$go_version
ynh_use_go
ynh_install_nodejs --nodejs_version=$nodejs_version
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Upgrading source files..." --weight=1 ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="run_fider" ynh_setup_source --dest_dir="$install_dir/sources" --full_replace=1
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir" chown -R "$app:www-data" "$install_dir"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Compiling Fider application..." --weight=1
ynh_exec_warn_less build_fider
#================================================= #=================================================
# UPDATE A CONFIG FILE # UPDATE A CONFIG FILE
#================================================= #=================================================
ynh_script_progression --message="Updating $app's configuration file..." --weight=1 ynh_script_progression --message="Updating $app's configuration file..." --weight=1
ynh_add_config --template="run_fider" --destination="$install_dir/run_fider" ynh_add_config --template="run_fider" --destination="$install_dir/run_fider"
chown "$app:www-data" "$install_dir/run_fider" chown "$app:www-data" "$install_dir/run_fider"
chmod 744 "$install_dir/run_fider" chmod 744 "$install_dir/run_fider"