Merge pull request #91 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2022-08-28 19:30:41 +02:00 committed by GitHub
commit ec83a54c90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 7 deletions

View file

@ -5,7 +5,7 @@
with_sftp=1 with_sftp=1
password="myreallystrengthpassword" password="myreallystrengthpassword"
is_public=1 is_public=1
phpversion="7.3" phpversion="7.4"
with_mysql=1 with_mysql=1
; Checks ; Checks
pkg_linter=1 pkg_linter=1
@ -27,7 +27,7 @@
with_sftp=0 with_sftp=0
password="" password=""
is_public=1 is_public=1
phpversion="7.3" phpversion="7.4"
with_mysql=1 with_mysql=1
; Checks ; Checks
setup_sub_dir=1 setup_sub_dir=1
@ -40,7 +40,7 @@
with_sftp=1 with_sftp=1
password="myreallystrengthpassword" password="myreallystrengthpassword"
is_public=1 is_public=1
phpversion="7.3" phpversion="7.4"
with_mysql=0 with_mysql=0
; Checks ; Checks
setup_sub_dir=1 setup_sub_dir=1

View file

@ -6,7 +6,7 @@
"en": "Custom Web app with SFTP access to serve static (HTML, CSS, JS) and PHP files", "en": "Custom Web app with SFTP access to serve static (HTML, CSS, JS) and PHP files",
"fr": "Application Web personnalisée avec accès SFTP pour servir des fichiers statiques (HTML, CSS, JS) et PHP" "fr": "Application Web personnalisée avec accès SFTP pour servir des fichiers statiques (HTML, CSS, JS) et PHP"
}, },
"version": "1.0~ynh9", "version": "1.0~ynh10",
"url": "https://github.com/YunoHost-Apps/my_webapp_ynh", "url": "https://github.com/YunoHost-Apps/my_webapp_ynh",
"license": "GPL-3.0-only", "license": "GPL-3.0-only",
"maintainer": { "maintainer": {
@ -18,12 +18,12 @@
"email": "maniackc_dev@crudelis.fr" "email": "maniackc_dev@crudelis.fr"
}], }],
"requirements": { "requirements": {
"yunohost": ">= 4.3.3" "yunohost": ">= 11.0.9"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
"nginx", "nginx",
"php7.3-fpm", "php7.4-fpm",
"mysql" "mysql"
], ],
"arguments": { "arguments": {
@ -65,7 +65,7 @@
"fr": "Choisissez une version PHP que vous souhaitez utiliser pour votre application" "fr": "Choisissez une version PHP que vous souhaitez utiliser pour votre application"
}, },
"choices" : ["none", "7.3", "7.4", "8.0"], "choices" : ["none", "7.3", "7.4", "8.0"],
"default" : "7.3" "default" : "7.4"
}, },
{ {
"name": "with_mysql", "name": "with_mysql",

View file

@ -78,6 +78,8 @@ if [ $with_mysql -eq 1 ]
then then
ynh_script_progression --message="Creating a MySQL database..." --weight=2 ynh_script_progression --message="Creating a MySQL database..." --weight=2
ynh_install_app_dependencies "php${phpversion}-mysql"
db_name=$(ynh_sanitize_dbid --db_name=$app) 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

View file

@ -66,6 +66,8 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
if [ $with_mysql -eq 1 ]; then if [ $with_mysql -eq 1 ]; then
ynh_script_progression --message="Restoring the MySQL database..." ynh_script_progression --message="Restoring the MySQL database..."
ynh_install_app_dependencies "php${phpversion}-mysql"
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd
ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./db.sql ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./db.sql

View file

@ -132,6 +132,11 @@ then
ynh_install_app_dependencies "php${phpversion}-fpm" ynh_install_app_dependencies "php${phpversion}-fpm"
fi fi
if [ $with_mysql -eq 1 ]
then
ynh_install_app_dependencies "php${phpversion}-mysql"
fi
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================