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 #48 from YunoHost-Apps/example

Level 2
This commit is contained in:
yalh76 2022-03-09 00:45:28 +01:00 committed by GitHub
commit f2113f052c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 18 additions and 9 deletions

View file

@ -3,8 +3,8 @@
; Manifest ; Manifest
domain="domain.tld" domain="domain.tld"
path="/path" path="/path"
admin="john"
is_public=1 is_public=1
admin="john"
port="3000" port="3000"
; Checks ; Checks
pkg_linter=1 pkg_linter=1
@ -15,6 +15,8 @@
setup_public=1 setup_public=1
upgrade=1 upgrade=1
upgrade=1 from_commit=893b873f00c2f9793369b7cd5d034b06605aaa8a upgrade=1 from_commit=893b873f00c2f9793369b7cd5d034b06605aaa8a
# 8.3.3~ynh1
upgrade=1 from_commit=993c3b904f558057de4278c1833448fc124e8626
backup_restore=1 backup_restore=1
multi_instance=0 multi_instance=0
port_already_use=1 port_already_use=1

View file

@ -38,14 +38,14 @@
"example": "/grafana", "example": "/grafana",
"default": "/grafana" "default": "/grafana"
}, },
{
"name": "admin",
"type": "user"
},
{ {
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",
"default": false "default": false
},
{
"name": "admin",
"type": "user"
} }
] ]
} }

View file

@ -74,7 +74,7 @@ fi
ynh_backup --src_path="/etc/influxdb" ynh_backup --src_path="/etc/influxdb"
ynh_backup --src_path="/etc/$app" ynh_backup --src_path="/etc/$app"
ynh_backup --src_path="/var/lib/grafana/plugins" ynh_backup --src_path="/var/lib/grafana/plugins" --not_mandatory
#================================================= #=================================================
# BACKUP THE MYSQL DATABASE # BACKUP THE MYSQL DATABASE

View file

@ -25,8 +25,8 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH path_url=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
admin=$YNH_APP_ARG_ADMIN
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME

View file

@ -27,7 +27,7 @@ db_user=$db_name
# REMOVE SERVICE INTEGRATION IN YUNOHOST # REMOVE SERVICE INTEGRATION IN YUNOHOST
#================================================= #=================================================
# Remove the service from the list of services known by Yunohost (added from `yunohost service add`) # Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status grafana-server >/dev/null if ynh_exec_warn_less yunohost service status grafana-server >/dev/null
then then
ynh_script_progression --message="Removing $app service integration..." --weight=1 ynh_script_progression --message="Removing $app service integration..." --weight=1
@ -62,6 +62,9 @@ ynh_remove_app_dependencies
#================================================= #=================================================
# SPECIFIC REMOVE # SPECIFIC REMOVE
#================================================= #=================================================
# REMOVE VARIOUS FILES
#=================================================
ynh_script_progression --message="Removing various files..."
# If NetData is installed, configure it not to feed InfluxDB any more # If NetData is installed, configure it not to feed InfluxDB any more
netdata_conf="/opt/netdata/etc/netdata/netdata.conf" netdata_conf="/opt/netdata/etc/netdata/netdata.conf"

View file

@ -76,7 +76,7 @@ ynh_script_progression --message="Restoring various files..." --weight=2
ynh_restore_file --origin_path="/etc/influxdb" ynh_restore_file --origin_path="/etc/influxdb"
ynh_restore_file --origin_path="/etc/grafana" ynh_restore_file --origin_path="/etc/grafana"
ynh_restore_file --origin_path="/var/lib/grafana/plugins" ynh_restore_file --origin_path="/var/lib/grafana/plugins" --not_mandatory
#================================================= #=================================================
# RESTORE THE INFLUXDB DATABASE # RESTORE THE INFLUXDB DATABASE

View file

@ -36,6 +36,10 @@ upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=4 ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=4
# Workaround for missing "/var/lib/grafana/plugins"
mkdir -p "/var/lib/grafana/plugins"
chown -R $app:$app "/var/lib/grafana/plugins"
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
ynh_clean_setup () { ynh_clean_setup () {