1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/tiddlywiki_ynh.git synced 2024-09-03 20:26:34 +02:00
tiddlywiki_ynh/scripts/upgrade

55 lines
2.1 KiB
Text
Raw Normal View History

2021-02-16 13:38:59 +01:00
#!/bin/bash
2021-02-16 14:17:45 +01:00
source _common.sh
2021-02-16 13:38:59 +01:00
source /usr/share/yunohost/helpers
2022-07-03 16:40:34 +02:00
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression "Stopping $app's systemd service..."
2022-07-03 16:40:34 +02:00
ynh_systemctl --service=$app --action="stop"
2022-07-03 16:40:34 +02:00
2021-02-16 13:38:59 +01:00
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression "Upgrading source files..."
2021-02-16 13:38:59 +01:00
2024-06-05 11:28:31 +02:00
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --full_replace
2021-05-28 11:34:56 +02:00
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
2022-07-03 16:40:34 +02:00
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression "Upgrading dependencies..."
2022-07-03 16:40:34 +02:00
ynh_nodejs_install
2022-07-03 16:40:34 +02:00
2021-02-16 13:38:59 +01:00
#=================================================
2023-03-12 22:29:28 +01:00
# REAPPLY SYSTEM CONFIGURATIONS
2021-02-16 13:38:59 +01:00
#=================================================
ynh_script_progression "Upgrading system configurations related to $app..."
2021-02-16 13:38:59 +01:00
2024-02-28 23:19:34 +01:00
# Create a dedicated NGINX config
ynh_config_add_nginx
2021-02-16 13:38:59 +01:00
2024-02-28 23:19:34 +01:00
# Create a dedicated systemd config
ynh_config_add_systemd
2021-02-16 14:17:45 +01:00
2024-06-05 11:34:32 +02:00
yunohost service add $app --description="A non-linear personal web notebook" --log="/var/log/$app/$app.log"
2021-03-09 23:13:38 +01:00
2021-02-16 14:17:45 +01:00
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression "Starting $app's systemd service..."
2021-02-16 14:17:45 +01:00
ynh_systemctl --service=$app --action="start" --log_path="systemd" --wait_until="Serving on"
2021-02-16 13:38:59 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Upgrade of $app completed"