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

Fix Unable to locate package (>

This commit is contained in:
yalh76 2022-01-29 03:49:58 +01:00
parent 5f7a32108f
commit 4e13fb8bd8
3 changed files with 15 additions and 15 deletions

View file

@ -13,9 +13,9 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
Tableaux de bords de supervision
**Version incluse :** 8.3.3~ynh1
**Version incluse :** 8.3.3~ynh1
**Démo :** https://play.grafana.org
**Démo :** https://play.grafana.org
## Captures d'écran
@ -61,10 +61,10 @@ LDAP and HTTP auth are supported.
## Documentations et ressources
* Site officiel de l'app : https://grafana.com/
* Dépôt de code officiel de l'app : https://github.com/grafana/
* Documentation YunoHost pour cette app : https://yunohost.org/app_grafana
* Signaler un bug : https://github.com/YunoHost-Apps/grafana_ynh/issues
* Site officiel de l'app : https://grafana.com/
* Dépôt de code officiel de l'app : https://github.com/grafana/
* Documentation YunoHost pour cette app : https://yunohost.org/app_grafana
* Signaler un bug : https://github.com/YunoHost-Apps/grafana_ynh/issues
## Informations pour les développeurs
@ -77,4 +77,4 @@ ou
sudo yunohost app upgrade grafana -u https://github.com/YunoHost-Apps/grafana_ynh/tree/testing --debug
```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps

View file

@ -185,15 +185,15 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name <<<
# Import default dashboard for NetData (source: https://grafana.com/grafana/dashboards/2701)
# Remove new lines
tr -d '\n' < ../conf/netdata_dashboard.json > dashboard.json
# Fill the template with the defined data source
# Fill the template with the defined data source
sed -i 's/${DS_CENTCOM-INFLUXDB}/InfluxDB/g' dashboard.json
# Escape the dashboard definition for MySQL query (source: https://stackoverflow.com/a/4383994)
dashboard=$(cat dashboard.json)
printf -v escaped_dashboard "%q" "$dashboard"
# Import dashboard into MySQL
# Import dashboard into MySQL
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name <<< "INSERT INTO dashboard (id, version, slug, title, data, org_id, created, updated, uid) VALUES
(99999, 0, 'NetData', 'NetData', \"$escaped_dashboard\", 1, '2020-05-16 14:36:50', '2020-05-16 14:36:50', 'yunohost');"
# Add dashboard version
# Add dashboard version
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name <<< "INSERT INTO dashboard_version (id, dashboard_id, parent_version, restored_from, version, created, created_by, message, data) VALUES (99999, 99999, 0, 0, 1, '2020-05-16 14:36:50', 1, 'YunoHost installer', \"$escaped_dashboard\");"
# Enable the systemd service so that InfluxDB and Grafana start at boot

View file

@ -39,7 +39,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
ynh_clean_check_starting
ynh_clean_check_starting
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
@ -66,7 +66,7 @@ if ynh_legacy_permissions_exists; then
ynh_app_setting_delete --app=$app --key=is_public
fi
# Migration: remove old repository if defined
# Migration: remove old repository if defined
if [ -f "/etc/apt/sources.list.d/grafana_stable.list" ] ; then
ynh_secure_remove --file="/etc/apt/sources.list.d/grafana_stable.list"
fi
@ -85,7 +85,7 @@ ynh_add_nginx_config
ynh_script_progression --message="Upgrading dependencies..." --weight=12
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"
ynh_install_extra_app_dependencies --repo="deb https://packages.grafana.com/oss/deb stable main" --package="grafana" --key="https://packages.grafana.com/gpg.key"
#=================================================
# SPECIFIC UPGRADE
@ -145,12 +145,12 @@ fi
# Update default dashboard for NetData (source: https://grafana.com/grafana/dashboards/2701)
# Remove new lines
tr -d '\n' < ../conf/netdata_dashboard.json > dashboard.json
# Fill the template with the defined data source
# Fill the template with the defined data source
sed -i 's/${DS_CENTCOM-INFLUXDB}/InfluxDB/g' dashboard.json
# Escape the dashboard definition for MySQL query
dashboard=$(cat dashboard.json)
printf -v escaped_dashboard "%q" "$dashboard"
# Import dashboard into MySQL
# Import dashboard into MySQL
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name <<< "UPDATE dashboard set data=\"$escaped_dashboard\" WHERE id=99999;"
# Insert dashboard version if non existent (for downward compatibility)
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name <<< "INSERT INTO dashboard_version (id, dashboard_id, parent_version, restored_from, version, created, created_by, message, data) VALUES (99999, 99999, 0, 0, 1, '2020-05-16 14:36:50', 1, 'YunoHost installer', \"$escaped_dashboard\");" > /dev/null 2>&1 || true