mirror of
https://github.com/YunoHost-Apps/netdata_ynh.git
synced 2024-09-03 19:46:33 +02:00
Install in /var/www/$app like any other app ..
This commit is contained in:
parent
0d9de5c6a6
commit
f65fcc1bed
4 changed files with 30 additions and 37 deletions
|
@ -55,7 +55,6 @@ ram.runtime = "50M"
|
|||
[resources.system_user]
|
||||
|
||||
[resources.install_dir]
|
||||
dir = "/opt/__APP__"
|
||||
|
||||
[resources.permissions]
|
||||
main.url = "/"
|
||||
|
|
|
@ -18,6 +18,22 @@ ynh_script_progression --message="Setting up source files..." --weight=11
|
|||
NETDATA_TMPDIR=$(mktemp -d)
|
||||
ynh_setup_source --dest_dir="$NETDATA_TMPDIR"
|
||||
|
||||
#=================================================
|
||||
# BUILD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Executing Netdata installer..." --weight=10
|
||||
|
||||
# create a temporary file for the log
|
||||
tmplog=$(mktemp /tmp/netdata-updater-log-XXXXXX.log)
|
||||
|
||||
pushd $NETDATA_TMPDIR
|
||||
# the installer.sh script will append "netdata" after the --install-prefix arg
|
||||
./netdata-installer.sh --install-prefix /var/www/ --dont-wait --disable-cloud --disable-telemetry --stable-channel >$tmplog 2>$tmplog || ynh_die "FAILED TO COMPILE/INSTALL NETDATA"
|
||||
popd
|
||||
|
||||
# Specific configuration
|
||||
configure_netdata
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -28,24 +44,6 @@ ynh_add_nginx_config
|
|||
|
||||
yunohost service add $app --description "Real-time performance and health monitoring" --log "$install_dir/var/log/netdata/error.log" "$install_dir/var/log/netdata/access.log" "$install_dir/var/log/netdata/debug.log"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
#=================================================
|
||||
# EXECUTE NETDATA INSTALLER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Executing Netdata installer..." --weight=10
|
||||
|
||||
# create a temporary file for the log
|
||||
tmplog=$(mktemp /tmp/netdata-updater-log-XXXXXX.log)
|
||||
|
||||
# Launch netdata installation in /opt directory
|
||||
pushd $NETDATA_TMPDIR
|
||||
./netdata-installer.sh --install-prefix /opt --dont-wait --disable-cloud --disable-telemetry --stable-channel >$tmplog 2>$tmplog || ynh_die "FAILED TO COMPILE/INSTALL NETDATA"
|
||||
popd
|
||||
|
||||
# Specific configuration
|
||||
configure_netdata
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
|
|
|
@ -19,13 +19,6 @@ ynh_script_progression --message="Restoring Netdata configuration directory..."
|
|||
|
||||
ynh_restore_file --origin_path="$install_dir/etc/netdata"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the NGINX web server configuration..."
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# INSTALL AND RESTORE THE APP CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -36,20 +29,23 @@ NETDATA_TMPDIR=$(mktemp -d)
|
|||
ynh_setup_source --dest_dir="$NETDATA_TMPDIR"
|
||||
|
||||
# create a temporary file for the log
|
||||
tmp=$(mktemp /tmp/netdata-updater-log-XXXXXX.log)
|
||||
# open fd 3 and send it to tmp
|
||||
exec 3>${tmp}
|
||||
tmplog=$(mktemp /tmp/netdata-updater-log-XXXXXX.log)
|
||||
|
||||
# Launch netdata installation in /opt directory
|
||||
cd $NETDATA_TMPDIR
|
||||
./netdata-installer.sh --install-prefix /opt --dont-wait --disable-cloud --disable-telemetry --stable-channel >&3 2>&3 || ynh_die "FAILED TO COMPILE/INSTALL NETDATA"
|
||||
|
||||
# close fd 3
|
||||
exec 3<&-
|
||||
pushd $NETDATA_TMPDIR
|
||||
# the installer.sh script will append "netdata" after the --install-prefix arg
|
||||
./netdata-installer.sh --install-prefix /var/www/ --dont-wait --disable-cloud --disable-telemetry --stable-channel >$tmplog 2>$tmplog || ynh_die "FAILED TO COMPILE/INSTALL NETDATA"
|
||||
popd
|
||||
|
||||
# Specific configuration
|
||||
configure_netdata
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the NGINX web server configuration..."
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
#=================================================
|
||||
|
|
|
@ -43,9 +43,9 @@ then
|
|||
# create a temporary file for the log
|
||||
tmplog=$(mktemp /tmp/netdata-updater-log-XXXXXX.log)
|
||||
|
||||
# Launch netdata installation in /opt directory
|
||||
pushd $NETDATA_TMPDIR
|
||||
./netdata-installer.sh --install-prefix /opt --dont-wait --disable-cloud >$tmplog 2>$tmplog || ynh_die "FAILED TO COMPILE/INSTALL NETDATA"
|
||||
# the installer.sh script will append "netdata" after the --install-prefix arg
|
||||
./netdata-installer.sh --install-prefix /var/www/ --dont-wait --disable-cloud >$tmplog 2>$tmplog || ynh_die "FAILED TO COMPILE/INSTALL NETDATA"
|
||||
popd
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue