2021-09-11 16:08:56 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# COMMON VARIABLES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# dependencies used by the app
|
2021-09-12 14:49:16 +02:00
|
|
|
pkg_dependencies="postgresql"
|
|
|
|
# Node version
|
|
|
|
NODEJS_VERSION=14
|
2021-09-11 16:08:56 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# PERSONAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2021-09-12 14:49:16 +02:00
|
|
|
install_node_deps() {
|
|
|
|
pushd "$final_path"
|
|
|
|
ynh_use_nodejs
|
|
|
|
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH npm install
|
|
|
|
popd
|
|
|
|
}
|
2021-09-11 16:08:56 +02:00
|
|
|
|
2021-09-12 14:49:16 +02:00
|
|
|
run_registration() {
|
|
|
|
pushd "$final_path"
|
|
|
|
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH NODE_ENV=production npm run start -- -r -c $config_path -f "$app.yaml"
|
|
|
|
popd
|
|
|
|
}
|
|
|
|
|
|
|
|
setup_final_path_rights() {
|
|
|
|
chmod 750 "$final_path"
|
|
|
|
chmod -R o-rwx "$final_path"
|
|
|
|
chown -R $app:$app "$final_path"
|
|
|
|
}
|