1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mongo-express_ynh.git synced 2024-09-03 19:46:04 +02:00

Upgrade to v1.02

This commit is contained in:
Gérard Collin 2024-01-21 12:19:03 +01:00
parent 84d9e79edd
commit 0562e56037
5 changed files with 29 additions and 11 deletions

View file

@ -2,4 +2,5 @@ ME_CONFIG_SITE_BASEURL=__PATH__
ME_CONFIG_BASICAUTH=false
ME_CONFIG_BASICAUTH_USERNAME=
ME_CONFIG_MONGODB_ENABLE_ADMIN=true
ME_CONFIG_SITE_SESSIONSECRET=SomeSecret6533
PORT=__PORT__

View file

@ -7,7 +7,7 @@ name = "Mongo Express"
description.en = "Admin server for Mongo and optionally Mongo database"
description.fr = "Serveur d'administration pour Mongo ainsi qu'optionnellement une base Mongo"
version = "1.0~ynh5"
version = "1.0.2~ynh1"
maintainers = ["Gerard Collin"]
@ -39,7 +39,7 @@ ram.runtime = "50M"
[install.init_main_permission]
type = "group"
default = false
default = "visitors"
[install.mongo_version]
ask.en = "Select the major version of Mongo to install or 'None' if already installed"
@ -50,8 +50,8 @@ ram.runtime = "50M"
[resources]
[resources.sources.main]
url = "https://github.com/mongo-express/mongo-express/archive/refs/tags/v1.0.0.tar.gz"
sha256 = "584bed4033f4b8f2f16824ec1eabfb3919aa04dfef72673a4e5ca8f4ef9f3b92"
url = "https://github.com/mongo-express/mongo-express/archive/refs/tags/v1.0.2.tar.gz"
sha256 = "c60a764aa71d37c18ec2bb6db8fe77356ca3bdbd91fa70a893106de1632640a1"
autoupdate.strategy = "latest_github_release"
autoupdate.asset = ".*.tar.gz"

View file

@ -13,6 +13,11 @@ nodejs_version=16
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
_install_yarn () {
ynh_exec_as "$app" "$ynh_node_load_PATH" npm install yarn
ynh_yarn="$install_dir/node_modules/.bin/yarn"
alias ynh_yarn="$ynh_yarn"
}
#=================================================
# FUTURE OFFICIAL HELPERS

View file

@ -13,10 +13,15 @@ source /usr/share/yunohost/helpers
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing NodeJS..." --weight=3
ynh_script_progression --message="Installing NodeJS & Yarn..." --weight=3
ynh_install_nodejs --nodejs_version="$nodejs_version"
pushd "$install_dir"
ynh_use_nodejs
_install_yarn
popd
# Install mongo server only if asked to
if [ "$mongo_version" != "None" ]; then
ynh_script_progression --message="Installing MongoDB..." --weight=3
@ -46,12 +51,13 @@ chown "$app:$app" "$install_dir/.env"
#=================================================
# BUILD NODEJS CODE
#=================================================
ynh_script_progression --message="Building NodeJS code and dependencies..." --weight=6
ynh_script_progression --message="Building NodeJS code ..." --weight=6
# Install Nodejs dependencies
# Build using Yarn
pushd "$install_dir"
ynh_use_nodejs
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" install
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_yarn" install
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" run build
popd
#=================================================

View file

@ -22,10 +22,15 @@ ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$a
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing NodeJS..." --weight=3
ynh_script_progression --message="Installing NodeJS & Yarn" --weight=3
ynh_install_nodejs --nodejs_version="$nodejs_version"
pushd "$install_dir"
ynh_use_nodejs
_install_yarn
popd
# Install mongo server only if asked to
if [ "$mongo_version" != "None" ]; then
ynh_script_progression --message="Installing MongoDB..." --weight=3
@ -57,10 +62,11 @@ chown "$app:$app" "$install_dir/.env"
#=================================================
ynh_script_progression --message="Building NodeJS code and dependencies..." --weight=6
# Install Nodejs dependencies
# Build using Yarn
pushd "$install_dir"
ynh_use_nodejs
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" install
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_yarn" install
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" run build
popd
#=================================================