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 18:13:25 +02:00
parent 0f527e9a16
commit 9851de8e34
3 changed files with 23 additions and 2 deletions

View file

@ -9,7 +9,8 @@ Group=__APP__
Environment=NODE_ENV=production
Environment=DOTENV_CONFIG_PATH=__INSTALL_DIR__/etc/facilmap.env
Environment="__YNH_NODE_LOAD_PATH__"
ExecStart=__INSTALL_DIR__/bin/facilmap-server
#ExecStart=__INSTALL_DIR__/bin/facilmap-server
ExecStart=/usr/bin/yarn sserve
WorkingDirectory=__INSTALL_DIR__
StandardOutput=syslog
StandardError=syslog

View file

@ -81,6 +81,12 @@ ram.runtime = "50M"
[resources]
[resources.sources]
[resources.sources.main]
url = "https://github.com/FacilMap/facilmap/archive/refs/tags/v4.1.1.tar.gz"
sha256 = "72cf9f7fbc6e9d5c73f7c1af02be63d2c5a99d13cf89c96af834db6004c89cf6"
[resources.ports]
[resources.system_user]
@ -93,5 +99,9 @@ ram.runtime = "50M"
[resources.apt]
packages = "mariadb-server"
extras.yarn.repo = "deb https://dl.yarnpkg.com/debian/ stable main"
extras.yarn.key = "https://dl.yarnpkg.com/debian/pubkey.gpg"
extras.yarn.packages = "yarn"
[resources.database]
type = "mysql"

View file

@ -16,6 +16,15 @@ ynh_script_progression --message="Installing NodeJS..." --weight=6
ynh_install_nodejs --nodejs_version=$nodejs_version
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=1
ynh_setup_source --dest_dir="$install_dir"
chown -R "$app:www-data" "$install_dir"
#=================================================
# CREATE A MYSQL DATABASE
#=================================================
@ -31,7 +40,8 @@ ynh_mysql_execute_as_root --database="$db_name" --sql="ALTER DATABASE $db_name C
ynh_script_progression --message="Building with NodeJS..." --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
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn build
popd
chmod 750 "$install_dir"