1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/facilmap_ynh.git synced 2024-09-03 18:36:07 +02:00
This commit is contained in:
Éric Gaspar 2024-06-08 19:00:21 +02:00
parent 258b342272
commit 7225c274db
3 changed files with 20 additions and 11 deletions

View file

@ -7,7 +7,7 @@ Type=simple
User=__APP__
Group=__APP__
Environment=NODE_ENV=production
Environment=DOTENV_CONFIG_PATH=__INSTALL_DIR__/etc/facilmap.env
Environment=DOTENV_CONFIG_PATH=__INSTALL_DIR__/config.env
Environment="__YNH_NODE_LOAD_PATH__"
#ExecStart=__INSTALL_DIR__/bin/facilmap-server
WorkingDirectory=__INSTALL_DIR__/server

View file

@ -53,11 +53,10 @@ chown -R "$app:www-data" "$install_dir"
#=================================================
ynh_script_progression --message="Adding configuration..." --weight=2
mkdir -p "$install_dir/etc"
ynh_add_config --template="config.env" --destination="$install_dir/etc/facilmap.env"
ynh_add_config --template="config.env" --destination="$install_dir/config.env"
chown -R "$app:www-data" "$install_dir/etc"
chmod 400 "$install_dir/etc/facilmap.env"
chown -R "$app:www-data" "$install_dir/config.env"
chmod 400 "$install_dir/config.env"
#=================================================
# SYSTEM CONFIGURATION

View file

@ -25,6 +25,15 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Upgrading source files..." --weight=1
ynh_setup_source --dest_dir="$install_dir"
chown -R "$app:www-data" "$install_dir"
#=================================================
# SPECIFIC UPGRADE
#=================================================
@ -32,8 +41,9 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#=================================================
ynh_script_progression --message="Install $app..." --weight=20
pushd $install_dir
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" install --prefix "$install_dir" -g facilmap-server@"$facilmap_version" 2>/dev/null
pushd "$install_dir"
ynh_exec_warn_less env $ynh_node_load_PATH yarn install
ynh_exec_warn_less env $ynh_node_load_PATH yarn build
popd
chmod 750 "$install_dir"
@ -45,11 +55,10 @@ chown -R "$app:www-data" "$install_dir"
#=================================================
ynh_script_progression --message="Updating config files..." --weight=2
mkdir -p "$install_dir/etc"
ynh_add_config --template="config.env" --destination="$install_dir/etc/facilmap.env"
ynh_add_config --template="config.env" --destination="$install_dir/config.env"
chown -R "$app:www-data" "$install_dir/etc"
chmod 400 "$install_dir/etc/facilmap.env"
chown -R "$app:www-data" "$install_dir/config.env"
chmod 400 "$install_dir/config.env"
#=================================================
# GENERIC FINALIZATION
@ -77,6 +86,7 @@ yunohost service add "$app" --description="Collaborative maps and routing" --log
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append
s
#=================================================
# START SYSTEMD SERVICE
#=================================================