1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/timeoff_ynh.git synced 2024-09-03 20:35:59 +02:00

Update upgrade

This commit is contained in:
ericgaspar 2022-02-10 12:06:06 +01:00
parent 9ce17ce39e
commit 0bf2929288
No known key found for this signature in database
GPG key ID: 574F281483054D44

View file

@ -78,7 +78,7 @@ then
ynh_script_progression --message="Upgrading source files..." ynh_script_progression --message="Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" ynh_setup_source --dest_dir="$final_path" --keep="$final_path/db.production.sqlite"
fi fi
chmod 750 "$final_path" chmod 750 "$final_path"
@ -102,21 +102,6 @@ ynh_install_app_dependencies $pkg_dependencies
# Install Nodejs # Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#=================================================
# UPGRADE NPM MODULES
#=================================================
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading TimeOff..."
pushd $final_path
ynh_use_nodejs
ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm cache clean 2>/dev/null
ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install 2>/dev/null
#ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run-script db-update --production 2>/dev/null
popd
fi
#================================================= #=================================================
# CONFIGURE # CONFIGURE
#================================================= #=================================================
@ -128,6 +113,19 @@ ynh_add_config --template="../conf/db.json" --destination="$final_path/config/db
chmod 600 "$final_path/config/db.json" chmod 600 "$final_path/config/db.json"
chown $app:$app "$final_path/config/db.json" chown $app:$app "$final_path/config/db.json"
#=================================================
# UPGRADE NPM MODULES
#=================================================
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading TimeOff..."
pushd $final_path
ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm cache clean 2>/dev/null
ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install 2>/dev/null
popd
fi
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================