mirror of
https://github.com/YunoHost-Apps/fider_ynh.git
synced 2024-09-03 18:36:11 +02:00
commit
38ed1bbc3f
4 changed files with 15 additions and 14 deletions
|
@ -7,7 +7,8 @@
|
|||
nodejs_version=16
|
||||
|
||||
# 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
|
||||
|
@ -42,17 +43,10 @@ build_fider() {
|
|||
# EXPERIMENTAL HELPERS
|
||||
#=================================================
|
||||
|
||||
_ynh_enable_backports() {
|
||||
version=$(ynh_get_debian_release)
|
||||
backports_file="/etc/apt/sources.list.d/backports_$version.list"
|
||||
if [[ -f "$backports_file" ]]; then
|
||||
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
|
||||
install_golang_from_backports() {
|
||||
ynh_exec_warn_less ynh_install_extra_app_dependencies \
|
||||
--repo="deb http://deb.debian.org/debian $version-backports main contrib non-free" \
|
||||
--package="$pkg_dependency_golang"
|
||||
}
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -69,8 +69,8 @@ ynh_app_setting_set --app=$app --key=port --value=$port
|
|||
#=================================================
|
||||
ynh_script_progression --message="Installing dependencies..." --weight=1
|
||||
|
||||
_ynh_enable_backports
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
install_golang_from_backports
|
||||
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -82,8 +82,8 @@ chmod +x "$final_path/run_fider"
|
|||
ynh_script_progression --message="Reinstalling dependencies..." --weight=1
|
||||
|
||||
# Define and install dependencies
|
||||
_ynh_enable_backports
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
install_golang_from_backports
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
|
|
|
@ -72,6 +72,12 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||
# 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" ]
|
||||
then
|
||||
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_install_app_dependencies $pkg_dependencies
|
||||
install_golang_from_backports
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
|
|
Loading…
Reference in a new issue