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:
commit
e52734d566
4 changed files with 26 additions and 38 deletions
|
@ -1,8 +1,10 @@
|
|||
var path = require('path');
|
||||
const path = require('path')
|
||||
const config = require('./lib/config')
|
||||
|
||||
module.exports = {
|
||||
'config': path.resolve('config.json'),
|
||||
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__'
|
||||
url: 'postgres://__DB_NAME__:__DB_PWD__@localhost:5432/__DB_NAME__'
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue