dist: install exported dashboards in grafana dashboard directory.
This commit is contained in:
parent
159790907e
commit
10311c12c6
3
Makefile
3
Makefile
@ -22,7 +22,7 @@ VERSION = "build-$(shell date +%F)"
|
||||
all:
|
||||
|
||||
install:
|
||||
install -d -m 755 $(DESTDIR)$(bindir) $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(unitdir) $(DESTDIR)$(oscplugindir) $(DESTDIR)$(sysconfdir)/$(package_name)
|
||||
install -d -m 755 $(DESTDIR)$(bindir) $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(unitdir) $(DESTDIR)$(oscplugindir) $(DESTDIR)$(sysconfdir)/$(package_name) $(DESTDIR)$(grafana_dashboards_dir)
|
||||
for i in $(pkgdata_SCRIPTS); do install -m 755 $$i $(DESTDIR)$(pkgdatadir); done
|
||||
chmod 644 $(DESTDIR)$(pkgdatadir)/osc-*.py
|
||||
for i in $(pkgdata_DATA); do cp -a $$i $(DESTDIR)$(pkgdatadir); done
|
||||
@ -34,6 +34,7 @@ install:
|
||||
for i in $(pkgdata_BINS); do ln -s $(pkgdatadir)/$$i $(DESTDIR)$(bindir)/osrt-$${i%.*}; done
|
||||
install -m 755 script/* $(DESTDIR)$(bindir)
|
||||
cp -R config/* $(DESTDIR)$(sysconfdir)/$(package_name)
|
||||
for i in metrics/grafana/* ; do ln -s $(pkgdatadir)/$$i $(DESTDIR)$(grafana_dashboards_dir)/osrt-$$(basename $$i); done
|
||||
|
||||
check: test
|
||||
|
||||
|
@ -5,6 +5,7 @@ datadir=$(prefix)/share
|
||||
sysconfdir=/etc
|
||||
unitdir=$(prefix)/lib/systemd/system
|
||||
pkgdatadir=$(datadir)/osc-plugin-factory
|
||||
grafana_dashboards_dir="/var/lib/grafana/dashboards/$(package_name)"
|
||||
oscplugindir=$(prefix)/lib/osc-plugins
|
||||
apachevhostsdir=$(sysconfdir)/apache2/vhosts.d
|
||||
tmpfilesdir=$(prefix)/lib/tmpfiles.d
|
||||
|
8
dist/package/openSUSE-release-tools.spec
vendored
8
dist/package/openSUSE-release-tools.spec
vendored
@ -151,6 +151,8 @@ Requires: osclib = %{version}
|
||||
# TODO Requires: python-influxdb, but package does not exist in Factory, but
|
||||
# present in Cloud:OpenStack:Master/python-influxdb.
|
||||
Recommends: python-influxdb
|
||||
Suggests: grafana
|
||||
Suggests: influxdb
|
||||
|
||||
%description metrics
|
||||
Ingest relevant OBS and annotation data to generate insightful metrics.
|
||||
@ -268,6 +270,7 @@ make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
%make_install \
|
||||
grafana_dashboards_dir="%{_localstatedir}/lib/grafana/dashboards/%{name}" \
|
||||
oscplugindir="%{osc_plugin_dir}" \
|
||||
VERSION="%{version}"
|
||||
|
||||
@ -340,6 +343,11 @@ exit 0
|
||||
%service_del_postun osrt-maintenance-incidents.service
|
||||
|
||||
# TODO Provide metrics service once #1006 is resolved.
|
||||
%postun metrics
|
||||
# If grafana-server.service is enabled then restart it to load new dashboards.
|
||||
if [ -x /usr/bin/systemctl ] && systemctl is-enabled grafana-server ; then
|
||||
/usr/bin/systemctl try-restart --no-block grafana-server
|
||||
fi
|
||||
|
||||
%pre repo-checker
|
||||
%service_add_pre osrt-repo-checker.service
|
||||
|
@ -23,7 +23,8 @@ issues are documented in:
|
||||
|
||||
- InfluxDB instance
|
||||
- Grafana instance
|
||||
- import `metrics/grafana` dashboards
|
||||
- `grafana.ini`:
|
||||
- `[dashboards.json].enabled = true` to use the dashboards provided by rpm
|
||||
- create data sources for desired projects
|
||||
setting name and database to the project name (ex. `openSUSE:Factory`)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user