mirror of
https://github.com/YunoHost-Apps/gancio_ynh.git
synced 2024-09-03 20:36:19 +02:00
Move admin creating after initial service start
This commit is contained in:
parent
c15da02bbb
commit
a94843306d
1 changed files with 12 additions and 3 deletions
|
@ -62,14 +62,12 @@ chown $app:$app "$install_dir/config.json"
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL YARN AND APP
|
# INSTALL YARN AND APP
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing app dependencies and creating admin user..." --weight=15
|
ynh_script_progression --message="Installing app dependencies..." --weight=15
|
||||||
|
|
||||||
pushd $install_dir
|
pushd $install_dir
|
||||||
ynh_use_nodejs
|
ynh_use_nodejs
|
||||||
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install # Install dependencies
|
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install # Install dependencies
|
||||||
#ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn build
|
#ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn build
|
||||||
admin_mail=$(ynh_user_get_info --username=$admin --key=mail)
|
|
||||||
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH ./server/cli.js users create $admin_mail $password admin --config ./config.json
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -80,8 +78,19 @@ popd
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
|
|
||||||
# Start a systemd service
|
# Start a systemd service
|
||||||
|
# It also initializes the database to allow creating the admin user
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# CREATING ADMIN USER
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Creating admin user..." --weight=15
|
||||||
|
|
||||||
|
pushd $install_dir
|
||||||
|
admin_mail=$(ynh_user_get_info --username=$admin --key=mail)
|
||||||
|
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH ./server/cli.js users create $admin_mail $password admin --config ./config.json
|
||||||
|
popd
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue