1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/reiverr_ynh.git synced 2024-09-03 20:16:14 +02:00

Merge pull request #2 from YunoHost-Apps/testing

Update restore
This commit is contained in:
Thomas 2023-11-03 11:02:15 +01:00 committed by GitHub
commit c251709264
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 17 deletions

View file

@ -9,7 +9,7 @@ Group=__APP__
WorkingDirectory=__INSTALL_DIR__/ WorkingDirectory=__INSTALL_DIR__/
Environment="__YNH_NODE_LOAD_PATH__" Environment="__YNH_NODE_LOAD_PATH__"
Environment=NODE_ENV=production Environment=NODE_ENV=production
ExecStart=__YNH_NPM__ run deploy ExecStart=__YNH_NODE__ __YNH_NPM__ run deploy
StandardOutput=append:/var/log/__APP__/__APP__.log StandardOutput=append:/var/log/__APP__/__APP__.log
StandardError=inherit StandardError=inherit

View file

@ -33,7 +33,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
# BACKUP LOGROTATE # BACKUP LOGROTATE
#================================================= #=================================================
ynh_backup --src_path="/etc/logrotate.d/$app" ynh_backup --src_path="/var/log/$app"
#================================================= #=================================================
# BACKUP SYSTEMD # BACKUP SYSTEMD

View file

@ -21,32 +21,25 @@ chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:$app "$install_dir" chown -R $app:$app "$install_dir"
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=10
# Define and install dependencies
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
# Reinstall Yarn
ynh_npm install --global yarn
# Reinstall vite
ynh_npm install --global vite
#================================================= #=================================================
# RESTORE SYSTEM CONFIGURATIONS # RESTORE SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
# Define and reinstall dependencies
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app.service" ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet systemctl enable $app.service --quiet
yunohost service add $app --log="/var/log/$app/$app.log" mkdir -p "/var/log/$app"
chown -R $app: "/var/log/$app"
ynh_restore_file --origin_path="/var/log/$app"
ynh_restore_file --origin_path="/etc/logrotate.d/$app" yunohost service add $app --log="/var/log/$app/$app.log"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION