@ -26,6 +26,7 @@ admin_wordpress=$YNH_APP_ARG_ADMIN
language=$YNH_APP_ARG_LANGUAGE
language=$YNH_APP_ARG_LANGUAGE
multisite=$YNH_APP_ARG_MULTISITE
multisite=$YNH_APP_ARG_MULTISITE
is_public=$YNH_APP_ARG_IS_PUBLIC
is_public=$YNH_APP_ARG_IS_PUBLIC
repo=$YNH_APP_ARG_REPO
app=$YNH_APP_INSTANCE_NAME
app=$YNH_APP_INSTANCE_NAME
@ -54,6 +55,7 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin_wordpress
ynh_app_setting_set --app=$app --key=admin --value=$admin_wordpress
ynh_app_setting_set --app=$app --key=language --value=$language
ynh_app_setting_set --app=$app --key=language --value=$language
ynh_app_setting_set --app=$app --key=multisite --value=$multisite
ynh_app_setting_set --app=$app --key=multisite --value=$multisite
ynh_app_setting_set --app=$app --key=repo --value=$repo
ynh_app_setting_set --app=$app --key=overwrite_nginx --value=1
ynh_app_setting_set --app=$app --key=overwrite_nginx --value=1
ynh_app_setting_set --app=$app --key=overwrite_phpfpm --value=1
ynh_app_setting_set --app=$app --key=overwrite_phpfpm --value=1
@ -70,14 +72,28 @@ db_name=$(ynh_sanitize_dbid --db_name=$app)
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name
ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name
#=================================================
# CLONE REPO IF REQUIRED
#=================================================
if [ -n $repo ]
then
GIT_SSH_COMMAND='ssh -i /etc/yunohost/sshkey -o IdentitiesOnly=yes' git clone $repo $final_path
git config --file $final_path/.git/config core.sshCommand "ssh -i /etc/yunohost/sshkey"
fi
#=================================================
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=4
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
if [ ! -d /var/www/$app/wp-admin ];
then
ynh_script_progression --message="Setting up source files..." --weight=4
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
fi
#=================================================
#=================================================
# NGINX CONFIGURATION
# NGINX CONFIGURATION
@ -133,6 +149,7 @@ done
#=================================================
#=================================================
# SETTING UP WITH CURL
# SETTING UP WITH CURL
#=================================================
#=================================================
ynh_script_progression --message="Installing wordpress with cURL..." --weight=10
ynh_script_progression --message="Installing wordpress with cURL..." --weight=10
# Set right permissions for cURL install
# Set right permissions for cURL install
@ -168,7 +185,7 @@ done
#=================================================
#=================================================
ynh_script_progression --message="Installing WordPress plugins..." --weight=20
ynh_script_progression --message="Installing WordPress plugins..." --weight=20
ynh_exec_warn_less wget --no-verbose https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar --output-document/usr/local/bin/wp
ynh_exec_warn_less wget --no-verbose https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar --output-document= /usr/local/bin/wp
chmod +x /usr/local/bin/wp
chmod +x /usr/local/bin/wp
wpcli_alias="php$phpversion /usr/local/bin/wp --allow-root --path=$final_path"
wpcli_alias="php$phpversion /usr/local/bin/wp --allow-root --path=$final_path"