mirror of
https://github.com/YunoHost-Apps/flarum_ynh.git
synced 2024-09-03 18:36:24 +02:00
Manage swap
This commit is contained in:
parent
beacda30d7
commit
a91f4d9cfc
4 changed files with 17 additions and 14 deletions
|
@ -5,6 +5,8 @@
|
||||||
# dependencies used by the app
|
# dependencies used by the app
|
||||||
pkg_dependencies=""
|
pkg_dependencies=""
|
||||||
|
|
||||||
|
swap_needed=1024
|
||||||
|
|
||||||
YNH_PHP_VERSION="7.3"
|
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"
|
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"
|
||||||
|
|
|
@ -132,14 +132,11 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP
|
# 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
|
ynh_add_swap --size=$swap_needed
|
||||||
if [[ $(ynh_get_ram --free) < 1000 ]]; then
|
|
||||||
ynh_add_swap --size=1000
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL COMPOSER DEPENDENCIES
|
# INSTALL COMPOSER DEPENDENCIES
|
||||||
|
|
|
@ -111,6 +111,13 @@ ynh_script_progression --message="Restoring the logrotate configuration..."
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
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
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -193,15 +193,12 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# SPECIFIC UPGRADE
|
||||||
#===================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE INSTALLED WITH CURRENT RAM
|
# ADD SWAP
|
||||||
#===================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Ensuring sufficient memory..." --weight=1
|
ynh_script_progression --message="Adding swap..."
|
||||||
|
|
||||||
# Check RAM
|
ynh_add_swap --size=$swap_needed
|
||||||
if [[ $(ynh_get_ram --free) < 1000 ]]; then
|
|
||||||
ynh_add_swap --size=1000
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# COMPOSER AND FLARUM UPGRADE
|
# COMPOSER AND FLARUM UPGRADE
|
||||||
|
|
Loading…
Reference in a new issue