1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/codimd_ynh.git synced 2024-09-03 18:16:32 +02:00

Merge branch 'patch' into testing

This commit is contained in:
ericgaspar 2021-05-08 18:37:11 +02:00
commit e52734d566
No known key found for this signature in database
GPG key ID: 574F281483054D44
4 changed files with 26 additions and 38 deletions

View file

@ -1,8 +1,10 @@
var path = require('path');
const path = require('path')
const config = require('./lib/config')
module.exports = {
'config': path.resolve('config.json'),
'migrations-path': path.resolve('lib', 'migrations'),
'models-path': path.resolve('lib', 'models'),
'url': 'postgres://__DB_NAME__:__DB_PWD__@localhost:5432/__DB_NAME__'
config: path.resolve('config.js'),
'migrations-path': path.resolve('lib', 'migrations'),
'models-path': path.resolve('lib', 'models'),
url: 'postgres://__DB_NAME__:__DB_PWD__@localhost:5432/__DB_NAME__'
}

View file

@ -117,12 +117,12 @@ path_url=${path_url:1}
cp ../conf/config.json.example "$final_path/config.json"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config.json"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/config.json"
ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="$final_path/config.json"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config.json"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/config.json"
ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="$final_path/config.json"
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config.json"
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/config.json"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/config.json"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/config.json"
ynh_store_file_checksum --file="$final_path/config.json"

View file

@ -69,9 +69,6 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
# Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
# Install Yarn
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
#=================================================
# CREATE DEDICATED USER
#=================================================
@ -115,12 +112,24 @@ ynh_add_nginx_config
#==============================================
ynh_script_progression --message="Building CodiMD... (this will take some time and resources!)" --weight=24
chown -R $app: $final_path
pushd "$final_path" || ynh_die
ynh_use_nodejs
ynh_exec_warn_less bin/setup
ynh_exec_warn_less yarn run build
ynh_exec_as $app env $ynh_node_load_PATH npm update
ynh_exec_as $app env $ynh_node_load_PATH npm run build
popd || ynh_die
#=================================================
# MODIFY A CONFIG FILE
#=================================================
ynh_script_progression --message="Modifying a config file..."
path=${path_url:1}
ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json"
ynh_add_config --template="../conf/.sequelizerc.example" --destination="$final_path/.sequelizerc"
#=================================================
# SETUP SYSTEMD
#=================================================
@ -128,19 +137,8 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service"
ynh_add_systemd_config
#=================================================
# MODIFY A CONFIG FILE
#=================================================
ynh_script_progression --message="Modifying a config file..."
path=${path_url:1}
ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json"
ynh_add_config --template="../conf/.sequelizerc.example" --destination="$final_path/.sequelizerc"
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -113,9 +113,6 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
# Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
# Install Yarn
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
#=================================================
# CREATE DEDICATED USER
#=================================================
@ -136,18 +133,10 @@ then
pushd "$final_path" || ynh_die
ynh_use_nodejs
ynh_exec_warn_less bin/setup
ynh_exec_warn_less yarn run build
ynh_exec_warn_less ynh_npm run build
popd || ynh_die
fi
#=================================================
# MODIFY A CONFIG FILE
#=================================================
#ynh_script_progression --message="Modifying a config file..." --weight=2
#path=${path_url:1}
#ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json"
#=================================================
# SETUP SYSTEMD
#=================================================
@ -155,7 +144,6 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=2
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service"
# Create a dedicated systemd config
ynh_add_systemd_config