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

Merge pull request #24 from YunoHost-Apps/enh-testing

Fix linter warning
This commit is contained in:
Éric Gaspar 2020-12-18 12:51:54 +01:00 committed by GitHub
commit 6600dd3b89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 16 additions and 58 deletions

View file

@ -1,4 +1,4 @@
# Grafana app for YunoHost
# Grafana for YunoHost
[![Integration level](https://dash.yunohost.org/integration/grafana.svg)](https://dash.yunohost.org/appci/app/grafana) ![](https://ci-apps.yunohost.org/ci/badges/grafana.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/grafana.maintain.svg)
[![Install grafana with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=grafana)
@ -56,7 +56,7 @@ LDAP and HTTP auth are supported.
#### Supported architectures
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/grafana%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/grafana/)
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/grafana%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/grafana/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/grafana%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/grafana/)
## Limitations
@ -79,10 +79,8 @@ None.
---
Developers info
----------------
## Developers info
**Only if you want to use a testing branch for coding, instead of merging directly into master.**
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/grafana_ynh/tree/testing).
To try the testing branch, please proceed like that.

View file

@ -17,11 +17,8 @@
upgrade=1 from_commit=a6403c448199ec31430a3fd88c8318965e9583c4
backup_restore=1
multi_instance=0
incorrect_path=1
port_already_use=1
change_url=1
;;; Levels
Level 5=auto
;;; Options
Email=
Notification=none
@ -29,4 +26,3 @@ Notification=none
; commit=a6403c448199ec31430a3fd88c8318965e9583c4
name=Fix backup/restore
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&admin_password=secret&language=en&is_public=1&

View file

@ -7,7 +7,7 @@ about: Create a report to help us debug, it would be nice to fill the template a
**How to post a meaningful bug report**
1. *Read this whole template first.*
2. *Determine if you are on the right place:*
- *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change url...), you are on the right place!*
- *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!*
- *Otherwise, the issue may be due to Grafana or InfluxDB themselves. Refer to its documentation or repository for help.*
- *If you have a doubt, post here, we will figure it out together.*
3. *Delete the italic comments as you write over them below, and remove this guide.*

View file

@ -34,25 +34,11 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
#=================================================
# STANDARD BACKUP STEPS
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
# N.B.: the following 'ynh_backup' calls are only a *declaration* of what needs
# to be backuped and not an actual copy of any file. The actual backup that
# creates and fill the archive with the files happens in the core after this
# script is called. Hence ynh_backups calls takes basically 0 seconds to run.
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_print_info --message="Stopping a systemd service..."
ynh_systemd_action --service_name="grafana-server" --action="stop" --log_path="/var/log/grafana/grafana.log"
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
ynh_print_info --message="Backing up configuration directories..."
ynh_backup --src_path="/etc/influxdb"
ynh_backup --src_path="/etc/grafana"
@ -61,7 +47,6 @@ ynh_backup --src_path="/var/lib/grafana/plugins"
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
ynh_print_info --message="Backing up nginx web server configuration..."
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
@ -77,7 +62,6 @@ ynh_mysql_dump_db --database="$db_name" > db.sql
#=================================================
# SPECIFIC BACKUP
#=================================================
ynh_print_info --message="Backing up the InfluxDB database..."
# Backup InfluxDB data
# Source: http://stackoverflow.com/questions/39501416/how-to-restore-data-base-using-influxd
@ -101,13 +85,6 @@ if [ -d "/var/lib/influxdb/data/opentsdb" ]; then
fi
fi
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_print_info --message="Starting a systemd service..."
ynh_systemd_action --service_name="grafana-server" --action="start" --log_path="/var/log/grafana/grafana.log"
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -205,19 +205,17 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name <<<
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
systemctl enable influxdb.service
systemctl enable grafana-server.service
systemctl enable influxdb.service --quiet
systemctl enable grafana-server.service --quiet
#=================================================
# GENERIC FINALIZATION
#=================================================
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
yunohost service add influxdb --description "open source time series database" --log "/var/log/grafana/grafana.log"
yunohost service add grafana-server --description "open source analytics and monitoring solution" --log "/var/log/grafana/grafana.log"
yunohost service add influxdb --description="open source time series database" --log="/var/log/grafana/grafana.log"
yunohost service add grafana-server --description="open source analytics and monitoring solution" --log="/var/log/grafana/grafana.log"
#=================================================
# START SYSTEMD SERVICE

View file

@ -76,10 +76,6 @@ fi
ynh_secure_remove --file="/etc/grafana/grafana.ini"
#=================================================
# GENERIC FINALIZATION
#=================================================
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -97,8 +97,8 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
yunohost service add influxdb --description "open source time series database" --log "/var/log/grafana/grafana.log"
yunohost service add grafana-server --description "open source analytics and monitoring solution" --log "/var/log/grafana/grafana.log" --timeout=600
yunohost service add influxdb --description="open source time series database" --log="/var/log/grafana/grafana.log"
yunohost service add grafana-server --description="open source analytics and monitoring solution" --log="/var/log/grafana/grafana.log"
#=================================================
# START SYSTEMD SERVICE

View file

@ -65,17 +65,8 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# CHECK THE PATH
#=================================================
# Normalize the URL path syntax
path_url=$(ynh_normalize_url_path --path_url=$path_url)
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -150,8 +141,6 @@ EOF
ynh_systemd_action --service_name=netdata --action="restart"
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
@ -168,6 +157,11 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name <<<
#=================================================
# GENERIC FINALIZATION
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
yunohost service add influxdb --description="open source time series database" --log="/var/log/grafana/grafana.log"
yunohost service add grafana-server --description="open source analytics and monitoring solution" --log="/var/log/grafana/grafana.log"
#=================================================
# SETUP SSOWAT
@ -188,7 +182,6 @@ ynh_script_progression --message="Restarting a systemd service..." --weight=2
ynh_systemd_action --service_name=grafana-server --action="restart" --log_path="/var/log/grafana/grafana.log" --line_match="HTTP Server Listen" --timeout=600
#=================================================
# RELOAD NGINX
#=================================================