From 62a53514a2526bb39ae95e7c2719e1519ce64e06 Mon Sep 17 00:00:00 2001 From: Limezy Date: Sun, 3 Dec 2023 14:41:56 +0700 Subject: [PATCH] Test install composer --- manifest.toml | 3 ++- scripts/_common.sh | 2 ++ scripts/install | 16 +++++++++++++++- scripts/upgrade | 1 - 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index c3a1ece..1a4089e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Moncycle" description.en = "Menstrual cycle follow-up for natural family planning" description.fr = "Suivi de cycle pour les méthodes naturelles de régulation de naissance" -version = "7.0~ynh5" +version = "7.0~ynh6" maintainers = ["Raoul de Limezy"] @@ -42,6 +42,7 @@ ram.runtime = "50M" sha256 = "25f435a55304a5692f55a681971ac41a034c527a87198612e3bfadb7a3b92028" [resources.system_user] + allow_email = true [resources.install_dir] diff --git a/scripts/_common.sh b/scripts/_common.sh index 1e47ce7..68a2ae1 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,6 +6,8 @@ # PHP APP SPECIFIC #================================================= +YNH_COMPOSER_VERSION="2.6.5" + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index e5bd13b..637cf1a 100755 --- a/scripts/install +++ b/scripts/install @@ -18,6 +18,8 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_setup_source --dest_dir="$install_dir" ynh_exec_warn_less mkdir "$install_dir/sessions" +ynh_exec_warn_less mkdir "$install_dir/soap_cache" +ynh_exec_warn_less mkdir "$install_dir/composer" chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" @@ -25,11 +27,23 @@ chown -R $app:www-data "$install_dir" pushd "$install_dir" ynh_exec_warn_less mv ./www_data/* . - ynh_exec_warn_less ./module/install.sh ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < db/table.sql ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < db/demo.sql popd +#================================================= + # SPECIFIC SETUP + #================================================= + # INSTALL COMPOSER DEPENDENCIES + #================================================= + ynh_script_progression --message="Installing composer dependencies..." --weight=1 + + ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --composerversion="$YNH_COMPOSER_VERSION" --workdir="$install_dir/composer" + +# worckaround while https://github.com/chartjs/Chart.js/issues/11478 is not fixed +ynh_exec_warn_less mkdir "$install_dir/vendor/chartjs" +ynh_exec_warn_less curl -o /var/www/html/vendor/chartjs/chart.js https://cdn.jsdelivr.net/npm/chart.js + #================================================= # PHP-FPM CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index bba3f33..cd4742a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -38,7 +38,6 @@ chown -R $app:www-data "$install_dir" pushd "$install_dir" ynh_exec_warn_less mv ./www_data/* . ynh_exec_warn_less mv /tmp/config.php . - ynh_exec_warn_less ./module/install.sh popd #=================================================