1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gitlab_ynh.git synced 2024-09-03 18:36:35 +02:00

Add bc as dependency

This commit is contained in:
Kay0u 2019-09-03 21:18:42 +02:00
parent 44ed195e56
commit f4ba8097c4
No known key found for this signature in database
GPG key ID: ABC3F52576D011D3
3 changed files with 20 additions and 15 deletions

View file

@ -4,7 +4,7 @@
# SET ALL CONSTANTS
#=================================================
pkg_dependencies="openssh-server"
pkg_dependencies="openssh-server bc"
#=================================================
# EXPERIMENTAL HELPERS

View file

@ -54,18 +54,6 @@ else
your hardware and the result of the command \"uname -m\"." 1
fi
# https://docs.gitlab.com/ce/install/requirements.html#unicorn-workers
unicorn_worker_processes=$(bc <<< "($(nproc) * 1.5 + 1) / 1")
# If the server has at least 2GB of RAM
if [ $(ynh_check_ram --no_swap) -ge 2000 ]; then
# Min 3 worker processes
unicorn_worker_processes=$(($unicorn_worker_processes>3?$unicorn_worker_processes:3))
else
# 2 worker processes
unicorn_worker_processes=2
fi
# Could be an option?
client_max_body_size="250m"
@ -84,7 +72,6 @@ ynh_app_setting_set --app=$app --key=use_web_account --value=$use_web_account
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
ynh_app_setting_set --app=$app --key=config_path --value=$config_path
ynh_app_setting_set --app=$app --key=architecture --value=$architecture
ynh_app_setting_set --app=$app --key=unicorn_worker_processes --value=$unicorn_worker_processes
ynh_app_setting_set --app=$app --key=client_max_body_size --value=$client_max_body_size
ynh_app_setting_set --app=$app --key=overwrite_nginx --value="1"
@ -112,6 +99,24 @@ ynh_script_progression --message="Installing dependencies..." --weight=5
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# DEFINE THE NUMBER OF WORKERS USED
#=================================================
# https://docs.gitlab.com/ce/install/requirements.html#unicorn-workers
unicorn_worker_processes=$(bc <<< "($(nproc) * 1.5 + 1) / 1")
# If the server has at least 2GB of RAM
if [ $(ynh_check_ram --no_swap) -ge 2000 ]; then
# Min 3 worker processes
unicorn_worker_processes=$(($unicorn_worker_processes>3?$unicorn_worker_processes:3))
else
# 2 worker processes
unicorn_worker_processes=2
fi
ynh_app_setting_set --app=$app --key=unicorn_worker_processes --value=$unicorn_worker_processes
#=================================================
# ADD SWAP IF NEEDED
#=================================================

View file

@ -75,7 +75,7 @@ fi
if [ -z "$unicorn_worker_processes" ]; then
# https://docs.gitlab.com/ce/install/requirements.html#unicorn-workers
unicorn_worker_processes=$(bc <<< "($(nproc) * 1.5 + 1) / 1")
unicorn_worker_processes=$(($(nproc) + 1 ))
# If the server has at least 2GB of RAM
if [ $(free -g --si | grep Mem: | awk '{print $2}') -ge 2 ]; then