diff --git a/scripts/_common.sh b/scripts/_common.sh index e361d8d..7b82f43 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,6 +5,8 @@ # dependencies used by the app pkg_dependencies="" +swap_needed=1024 + YNH_PHP_VERSION="7.3" extra_php_dependencies="php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-pdo-mysql php${YNH_PHP_VERSION}-tokenizer php${YNH_PHP_VERSION}-zip" diff --git a/scripts/install b/scripts/install index 3d528be..1079341 100644 --- a/scripts/install +++ b/scripts/install @@ -132,14 +132,11 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC SETUP #================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH CURRENT RAM +# ADD SWAP #================================================= -ynh_script_progression --message="Ensuring sufficient memory..." --weight=1 +ynh_print_info --message="Adding swap..." -# Check RAM -if [[ $(ynh_get_ram --free) < 1000 ]]; then - ynh_add_swap --size=1000 -fi +ynh_add_swap --size=$swap_needed #================================================= # INSTALL COMPOSER DEPENDENCIES diff --git a/scripts/restore b/scripts/restore index d4a4e78..e263560 100644 --- a/scripts/restore +++ b/scripts/restore @@ -111,6 +111,13 @@ ynh_script_progression --message="Restoring the logrotate configuration..." ynh_restore_file --origin_path="/etc/logrotate.d/$app" +#================================================= +# ADD SWAP +#================================================= +ynh_script_progression --message="Adding swap..." + +ynh_add_swap --size=$swap_needed + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ba0e421..2e71ca6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -193,15 +193,12 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC UPGRADE -#=================================================== -# CHECK IF THE APP CAN BE INSTALLED WITH CURRENT RAM -#=================================================== -ynh_script_progression --message="Ensuring sufficient memory..." --weight=1 +#================================================= +# ADD SWAP +#================================================= +ynh_script_progression --message="Adding swap..." -# Check RAM -if [[ $(ynh_get_ram --free) < 1000 ]]; then - ynh_add_swap --size=1000 -fi +ynh_add_swap --size=$swap_needed #================================================= # COMPOSER AND FLARUM UPGRADE