1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/prestashop_ynh.git synced 2024-09-03 20:06:39 +02:00

enh: install

This commit is contained in:
Tagadda 2022-04-08 23:25:58 +00:00
parent ae757d63ac
commit 578bd0ac6e
2 changed files with 29 additions and 21 deletions

View file

@ -52,6 +52,24 @@
"name": "is_public",
"type": "boolean",
"default": true
},
{
"name": "language",
"type": "select",
"choices": ["English", "Français"],
"default": "Français"
},
{
"name": "shopname",
"type": "string"
},
{
"name": "admin",
"type": "user"
},
{
"name": "password",
"type": "password"
}
]
}

View file

@ -27,6 +27,10 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH
is_public=$YNH_APP_ARG_IS_PUBLIC
language=$YNH_APP_ARG_LANGUAGE
shopname=$YNH_APP_ARG_SHOPNAME
admin=$YNH_APP_ARG_ADMIN
password=$YNH_APP_ARG_PASSWORD
phpversion=$YNH_PHP_VERSION
app=$YNH_APP_INSTANCE_NAME
@ -109,29 +113,15 @@ ynh_add_fpm_config
#=================================================
# SPECIFIC SETUP
#=================================================
# ...
# SETUP APPLICATION
#=================================================
ynh_script_progression --message="Installing Prestashop..." --weight=1
#=================================================
# SETUP APPLICATION WITH CURL
#=================================================
### Use these lines only if the app installation needs to be finalized through
### web forms. We generally don't want to ask the final user,
### so we're going to use curl to automatically fill the fields and submit the
### forms.
# Set the app as temporarily public for curl call
ynh_script_progression --message="Configuring SSOwat..." --weight=1
# Making the app public for curl
ynh_permission_update --permission="main" --add="visitors"
# Installation with curl
ynh_script_progression --message="Finalizing installation..." --weight=1
ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3"
# Remove the public access
ynh_permission_update --permission="main" --remove="visitors"
# Installing Prestashop
# https://docs.prestashop-project.org/1.7-documentation/getting-started/installing-prestashop-using-command-line-script
pushd $final_path
ynh_exec_as $app php index_cli.php --domain=$domain --db_server=127.0.0.1 --db_name=$db_name --db_user=$db_user --db_password=$db_pwd --name=$shopname --firstname=$admin_firstname --lastname=$admin_lastname --email=$admin_email --password=$password
popd
#=================================================
# GENERIC FINALIZATION