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

Merge pull request #4 from YunoHost-Apps/testing

Testing
This commit is contained in:
Salamandar 2022-12-03 17:57:50 +01:00 committed by GitHub
commit 38ed1bbc3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 14 deletions

View file

@ -7,7 +7,8 @@
nodejs_version=16 nodejs_version=16
# dependencies used by the app (must be on a single line) # dependencies used by the app (must be on a single line)
pkg_dependencies="golang-1.18-go postgresql" pkg_dependencies="postgresql"
pkg_dependency_golang="golang-1.18-go"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS
@ -42,17 +43,10 @@ build_fider() {
# EXPERIMENTAL HELPERS # EXPERIMENTAL HELPERS
#================================================= #=================================================
_ynh_enable_backports() { install_golang_from_backports() {
version=$(ynh_get_debian_release) ynh_exec_warn_less ynh_install_extra_app_dependencies \
backports_file="/etc/apt/sources.list.d/backports_$version.list" --repo="deb http://deb.debian.org/debian $version-backports main contrib non-free" \
if [[ -f "$backports_file" ]]; then --package="$pkg_dependency_golang"
return 0
fi
{
echo "deb http://deb.debian.org/debian $version-backports main contrib non-free"
echo "deb-src http://deb.debian.org/debian $version-backports main contrib non-free"
} > "$backports_file"
apt update
} }
#================================================= #=================================================

View file

@ -69,8 +69,8 @@ ynh_app_setting_set --app=$app --key=port --value=$port
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies..." --weight=1 ynh_script_progression --message="Installing dependencies..." --weight=1
_ynh_enable_backports
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
install_golang_from_backports
ynh_install_nodejs --nodejs_version=$nodejs_version ynh_install_nodejs --nodejs_version=$nodejs_version
#================================================= #=================================================

View file

@ -82,8 +82,8 @@ chmod +x "$final_path/run_fider"
ynh_script_progression --message="Reinstalling dependencies..." --weight=1 ynh_script_progression --message="Reinstalling dependencies..." --weight=1
# Define and install dependencies # Define and install dependencies
_ynh_enable_backports
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
install_golang_from_backports
#================================================= #=================================================
# RESTORE THE NGINX CONFIGURATION # RESTORE THE NGINX CONFIGURATION

View file

@ -72,6 +72,12 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
# Moved fron /opt to /var/www
if [ -d "/opt/yunohost/$app" ]; then
rm -rf "$final_path"
mv "/opt/yunohost/$app" "$final_path"
fi
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." --weight=1 ynh_script_progression --message="Upgrading source files..." --weight=1
@ -96,6 +102,7 @@ chown -R $app:www-data "$final_path"
ynh_script_progression --message="Upgrading dependencies..." --weight=1 ynh_script_progression --message="Upgrading dependencies..." --weight=1
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
install_golang_from_backports
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION