1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/photoprism_ynh.git synced 2024-09-03 19:56:41 +02:00
This commit is contained in:
Limezy 2022-06-08 23:46:27 +07:00
parent 14ced63904
commit c4b3f50e98
3 changed files with 3 additions and 30 deletions

View file

@ -8,7 +8,6 @@
source _common.sh source _common.sh
source ynh_install_go source ynh_install_go
source ynh_add_swap
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
@ -61,27 +60,6 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=language --value=$language_key ynh_app_setting_set --app=$app --key=language --value=$language_key
#=================================================
# ADD SWAP IF NEEDED
#=================================================
total_memory=$(ynh_get_ram --total)
swap_needed=0
ynh_script_progression --message="The system currently has $(ynh_get_ram --total) Mo of RAM..."
# Need at least 2Go of RAM to build and run
if [ $total_memory -lt 2048 ]; then
swap_needed=$((2048 - total_memory))
fi
if [ $swap_needed -gt 0 ]; then
ynh_script_progression --message="Adding $swap_needed Mo to swap..."
ynh_add_swap --size=$swap_needed
fi
ynh_script_progression --message="The system now has $(ynh_get_ram --total) Mo of RAM..."
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
#================================================= #=================================================
@ -171,6 +149,7 @@ pushd "$final_path"
# Setup node environment # Setup node environment
export NODE_OPTIONS=--max_old_space_size=1024 export NODE_OPTIONS=--max_old_space_size=1024
# Build server from source # Build server from source
ynh_secure_remove --file="$final_path/build"
make all install DESTDIR=$final_path/build 2>&1 make all install DESTDIR=$final_path/build 2>&1
ynh_secure_remove --file="$final_path/go" ynh_secure_remove --file="$final_path/go"
popd popd

View file

@ -105,13 +105,6 @@ then
ynh_exec_warn_less yunohost firewall disallow TCP $port ynh_exec_warn_less yunohost firewall disallow TCP $port
fi fi
#=================================================
# REMOVE SWAP IF NEEDED
#=================================================
ynh_script_progression --message="Removing swap if needed..."
ynh_del_swap
#================================================= #=================================================
# SPECIFIC REMOVE # SPECIFIC REMOVE
#================================================= #=================================================

View file

@ -8,7 +8,6 @@
source _common.sh source _common.sh
source ynh_install_go source ynh_install_go
source ynh_add_swap
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
@ -119,6 +118,8 @@ pushd "$final_path"
export GOBIN=$GOPATH/bin export GOBIN=$GOPATH/bin
# Setup tensorflow library # Setup tensorflow library
./scripts/dist/install-tensorflow.sh ./scripts/dist/install-tensorflow.sh
# Setup node environment
export NODE_OPTIONS=--max_old_space_size=1024
# Build server from source # Build server from source
ynh_secure_remove --file="$final_path/build" ynh_secure_remove --file="$final_path/build"
make all install DESTDIR=$final_path/build 2>&1 make all install DESTDIR=$final_path/build 2>&1