chibisafe_ynh/scripts/upgrade

68 lines
2.2 KiB
Text
Raw Normal View History

2014-10-20 12:55:53 -04:00
#!/bin/bash
2017-06-02 12:44:37 -04:00
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2017-06-05 07:06:35 -04:00
source _common.sh
2017-06-02 12:44:37 -04:00
source /usr/share/yunohost/helpers
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
2024-11-15 18:35:15 -05:00
2024-06-20 17:49:43 -04:00
ynh_script_progression "Stopping $app's systemd service..."
2024-06-20 17:49:43 -04:00
ynh_systemctl --service="$app" --action="stop"
2017-06-02 12:44:37 -04:00
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
2019-04-18 13:58:47 -04:00
2024-11-15 18:35:15 -05:00
ynh_script_progression "Upgrading source files..."
2024-11-15 18:35:15 -05:00
ynh_setup_source --dest_dir="$install_dir" --full_replace --keep="database uploads minio"
2024-11-15 18:35:15 -05:00
chown -R "$app:www-data" "$install_dir"
2017-06-02 12:44:37 -04:00
#=================================================
# REAPPLY SYSTEM CONFIGURATIONS
#=================================================
2024-11-15 18:35:15 -05:00
ynh_script_progression "Upgrading system configurations related to $app..."
2024-06-20 17:49:43 -04:00
ynh_config_add_nginx
2024-11-15 20:25:22 -05:00
ynh_add_systemd_config --service= "$app-backend" --template="$backend"
2024-11-15 20:25:22 -05:00
ynh_add_systemd_config --service= "$app-frontend" --template="$frontend"
yunohost service add "$app-backend" --description="a beautiful and performant vault to save all your files in the cloud" --log="/var/log/$app/$app.log"
yunohost service add "$app-frontend" --description="a beautiful and performant vault to save all your files in the cloud" --log="/var/log/$app/$app.log"
2024-11-15 18:35:15 -05:00
ynh_script_progression "Installing $app..."
2024-11-15 18:35:15 -05:00
pushd $install_dir
ynh_hide_warnings ynh_exec_as_app yarn install
ynh_hide_warnings ynh_exec_as_app yarn workspace @chibisafe/backend generate
ynh_hide_warnings ynh_exec_as_app yarn workspace @chibisafe/backend migrate
ynh_hide_warnings ynh_exec_as_app yarn build
popd
2019-05-02 14:44:22 -04:00
#=================================================
# START SYSTEMD SERVICE
#=================================================
2024-06-20 17:49:43 -04:00
ynh_script_progression "Starting $app's systemd service..."
2019-05-02 14:44:22 -04:00
2024-11-15 20:25:22 -05:00
ynh_systemctl --service="$app-backend" --action="start"
ynh_systemctl --service="$app-frontend" --action="start"
2019-05-02 14:44:22 -04:00
2019-02-10 09:02:38 -05:00
#=================================================
# END OF SCRIPT
#=================================================
2024-06-20 17:49:43 -04:00
ynh_script_progression "Upgrade of $app completed"