1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/grist_ynh.git synced 2024-09-03 20:36:18 +02:00
This commit is contained in:
Éric Gaspar 2024-09-03 14:08:57 +02:00
parent 0e2f2ea325
commit 7923f6bf93
5 changed files with 15 additions and 48 deletions

View file

@ -1,6 +1,5 @@
#!/bin/bash
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
@ -16,7 +15,6 @@ ynh_backup "$install_dir"
# BACKUP THE DATA DIR
#=================================================
# Only relevant if there is a "data_dir" resource for this app
ynh_backup "$data_dir"
#=================================================
@ -25,18 +23,8 @@ ynh_backup "$data_dir"
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
#=================================================
ynh_backup "/etc/logrotate.d/$app"
#=================================================
# BACKUP SYSTEMD
#=================================================
ynh_backup "/etc/systemd/system/$app.service"
#=================================================

View file

@ -28,8 +28,8 @@ pushd "$install_dir"
ynh_hide_warnings ynh_exec_as_app yarn install --pure-lockfile
ynh_hide_warnings ynh_exec_as_app yarn install:python
ynh_hide_warnings ynh_exec_as_app :$install_dir/node_modules/.bin yarn run build:prod
ynh_hide_warnings ynh_exec_as_app yarn cache clean
ynh_hide_warnings ynh_exec_as_app $install_dir/node_modules/.bin yarn run build:prod
ynh_hide_warnings ynh_exec_as_app yarn cache clean
popd
pushd "$install_dir/sandbox/pyodide"

View file

@ -12,7 +12,6 @@ ynh_script_progression "Removing system configurations related to $app..."
redis_db=$(ynh_app_setting_get --key=redis_db)
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_hide_warnings yunohost service status $app >/dev/null
then
ynh_script_progression "Removing $app service integration..."

View file

@ -1,6 +1,5 @@
#!/bin/bash
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
@ -17,7 +16,8 @@ ynh_script_progression "Restoring the app main directory..."
ynh_restore "$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"
chown -R $app:www-data "$install_dir"
#=================================================
# RESTORE THE DATA DIRECTORY
#=================================================
@ -25,7 +25,6 @@ ynh_script_progression "Restoring the data directory..."
ynh_restore "$data_dir"
# (Same as for install dir)
chown -R $app:www-data "$data_dir"
#=================================================
@ -49,7 +48,6 @@ ynh_restore "/etc/logrotate.d/$app"
#=================================================
ynh_script_progression "Reloading NGINX web server and $app's service..."
# Typically you only have either $app or php-fpm but not both at the same time...
ynh_systemctl --service=$app --action="start"
ynh_systemctl --service=nginx --action=reload

View file

@ -33,42 +33,27 @@ fi
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression "Upgrading dependencies..."
ynh_nodejs_install
#=================================================
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression "Upgrading source files..."
# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed
if ynh_app_upstream_version_changed
then
ynh_script_progression "Upgrading source files..."
ynh_setup_source --dest_dir="$install_dir" --full_replace
# Download, check integrity, uncompress and patch the source from manifest.toml
ynh_setup_source --dest_dir="$install_dir" --full_replace
fi
pushd "$install_dir"
ynh_hide_warnings ynh_exec_as_app yarn install --pure-lockfile
ynh_hide_warnings ynh_exec_as_app yarn install:python
ynh_hide_warnings ynh_exec_as_app $install_dir/node_modules/.bin yarn run build:prod
ynh_hide_warnings ynh_exec_as_app yarn cache clean
popd
#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"
# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed
if ynh_app_upstream_version_changed
then
pushd "$install_dir"
ynh_hide_warnings ynh_exec_as_app node_load_PATH yarn install --pure-lockfile
ynh_hide_warnings ynh_exec_as_app node_load_PATH yarn install:python
ynh_hide_warnings ynh_exec_as_app node_load_PATH:$install_dir/node_modules/.bin yarn run build:prod
ynh_hide_warnings ynh_exec_as_app node_load_PATH yarn cache clean
popd
pushd "$install_dir/sandbox/pyodide"
ynh_hide_warnings ynh_exec_as_app node_load_PATH make setup
popd
fi
pushd "$install_dir/sandbox/pyodide"
ynh_hide_warnings ynh_exec_as_app node_load_PATH make setup
popd
#=================================================
# REAPPLY SYSTEM CONFIGURATIONS
@ -93,9 +78,6 @@ ynh_script_progression "Updating configuration..."
admin_email=$(ynh_user_get_info --username=$admin --key=mail)
ynh_config_add --template="default.env" --destination="$install_dir/default.env"
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/default.env"
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/default.env"
#=================================================
# START SYSTEMD SERVICE
#=================================================