1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/grafana_ynh.git synced 2024-09-03 20:36:29 +02:00

Update others scripts: remove, upgrade, restore

This commit is contained in:
Nathanaël HANNEBERT 2021-12-10 12:10:15 +01:00
parent 05541f04d0
commit 62cbdf0852
3 changed files with 43 additions and 2 deletions

View file

@ -50,6 +50,7 @@ ynh_script_progression --message="Removing dependencies..." --weight=26
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
ynh_exec_warn_less dpkg -r grafana
#=================================================
# REMOVE NGINX CONFIGURATION

View file

@ -58,7 +58,27 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=24
# Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies
ynh_install_extra_app_dependencies --repo="deb https://packages.grafana.com/oss/deb stable main" --package="grafana" --key="https://packages.grafana.com/gpg.key"
#=================================================
# DOWNLOAD AND REINSTALL GRAFANA DEB PACKAGE
#=================================================
ynh_script_progression --message="Downloading Grafana..." --weight=11
temp_folder="$(mktemp -d)"
grafana_deb_dst="$temp_folder/grafana_deb.deb"
if [ -n "$(uname -m | grep armv6)" ]
then
grafana_deb_url="$url_armv6"
else
grafana_deb_url="$url"
fi
ynh_exec_quiet "wget -q -O $grafana_deb_dst $grafana_deb_url"
ynh_script_progression --message="Installing Grafana..." --weight=11
DEBIAN_FRONTEND=noninteractive ynh_exec_warn_less dpkg --force-confold -i $grafana_deb_dst
#=================================================
# RESTORE THE MYSQL DATABASE

View file

@ -85,7 +85,27 @@ if [ -f "/etc/apt/sources.list.d/grafana_stable.list" ] ; then
fi
ynh_install_app_dependencies $pkg_dependencies
ynh_install_extra_app_dependencies --repo="deb https://packages.grafana.com/oss/deb stable main" --package="grafana (=$GRAFANA_VERSION)" --key="https://packages.grafana.com/gpg.key"
#=================================================
# DOWNLOAD AND INSTALL UPDATED GRAFANA DEB PACKAGE
#=================================================
ynh_script_progression --message="Downloading Grafana..." --weight=11
temp_folder="$(mktemp -d)"
grafana_deb_dst="$temp_folder/grafana_deb.deb"
if [ -n "$(uname -m | grep armv6)" ]
then
grafana_deb_url="$url_armv6"
else
grafana_deb_url="$url"
fi
ynh_exec_quiet "wget -q -O $grafana_deb_dst $grafana_deb_url"
ynh_script_progression --message="Installing Grafana..." --weight=11
DEBIAN_FRONTEND=noninteractive ynh_exec_warn_less dpkg --force-confold -i $grafana_deb_dst
#=================================================
# SPECIFIC UPGRADE