chibisafe_ynh/scripts/install

68 lines
2.2 KiB
Text
Raw Normal View History

2014-10-20 12:55:53 -04:00
#!/bin/bash
2017-06-02 12:23:51 -04:00
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2017-06-05 07:11:48 -04:00
source _common.sh
2017-06-02 12:23:51 -04:00
source /usr/share/yunohost/helpers
2024-11-15 18:15:14 -05:00
#=================================================
# INTALL NODEJS
#=================================================
2024-11-15 12:15:51 -05:00
ynh_script_progression --message="Installing dependencies..." --weight=7
2024-11-15 17:32:41 -05:00
ynh_hide_warnings ynh_nodejs_install
2024-11-15 12:15:51 -05:00
2023-06-08 11:27:51 -04:00
#=================================================
2017-06-02 12:23:51 -04:00
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
2024-11-15 18:15:14 -05:00
ynh_script_progression "Setting up source files..."
2018-06-28 16:05:35 -04:00
ynh_setup_source --dest_dir="$install_dir"
2023-12-29 21:02:42 -05:00
chown -R "$app:www-data" "$install_dir"
2017-06-02 12:23:51 -04:00
#=================================================
# SYSTEM CONFIGURATION
2017-06-02 12:23:51 -04:00
#=================================================
2024-11-15 18:15:14 -05:00
2024-06-20 17:49:43 -04:00
ynh_script_progression "Adding system configurations related to $app..."
2017-06-02 12:23:51 -04:00
2024-06-20 17:49:43 -04:00
ynh_config_add_nginx
2022-05-30 19:56:33 -04:00
2024-11-15 20:47:00 -05:00
ynh_config_add_systemd --service= "${app}-backend" --template="backend.service"
2021-04-29 14:58:35 -04:00
2024-11-15 20:47:00 -05:00
ynh_config_add_systemd --service= "${app}-frontend" --template="frontend.service"
2024-11-15 20:24:23 -05:00
2024-11-15 20:32:47 -05:00
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"
2024-11-15 20:24:23 -05:00
2024-11-15 20:32:47 -05:00
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"
2021-04-29 14:58:35 -04:00
2024-11-15 17:49:34 -05:00
ynh_script_progression "Installing $app..."
2018-06-28 16:05:35 -04:00
2024-11-15 12:02:59 -05:00
pushd $install_dir
2024-11-15 17:46:08 -05:00
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
2024-11-15 12:02:59 -05:00
popd
2017-06-02 12:23:51 -04:00
#=================================================
2019-05-02 14:44:22 -04:00
# START SYSTEMD SERVICE
#=================================================
2024-11-15 18:15:14 -05:00
ynh_script_progression "Starting $app's systemd service..."
2019-05-02 14:44:22 -04:00
2024-11-15 20:32:47 -05:00
ynh_systemctl --service="${app}-backend" --action="start"
2024-11-15 20:24:23 -05:00
2024-11-15 20:32:47 -05:00
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 "Installation of $app completed"